RosettaCodeData/Task/Memory-allocation/Factor/memory-allocation-2.factor

7 lines
158 B
Factor
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
STRUCT: foo { a int } { b foo* } ;
[
foo malloc-struct &free ! gets freed at end of the current with-destructors scope
! do stuff
] with-destructors