All pastes #225521 Raw Edit

Someone

public java v1 · immutable
#225521 ·published 2006-10-27 23:56 UTC
rendered paste body
import std.c.stdlib;import std.stdio;import std.gc;class Wrapper {	int *foshizzle;	this ( ) {		this.foshizzle = cast(int *)malloc( 1024 );	}	~this ( ) {		free( this.foshizzle );		writefln("~Wrapper");	}}void do_something( inout Wrapper bar ) {	bar = bar;}void main ( ) {	Wrapper foo = new Wrapper( );	do_something( foo );	delete foo;	std.gc.fullCollect( );	writefln("main");}/*as above:jim@panicroom:~/test$ ./test~Wrappermain//fullcollect:jim@panicroom:~/test$ ./test~Wrappermain//delete:jim@panicroom:~/test$ ./testmain~Wrapper//delete + //fullcollect:jim@panicroom:~/test$ ./testmain~WrapperRESULT: I win. ;P*/