On Thursday, 25 September 2014 at 20:58:29 UTC, Gary Willoughby wrote:
A few questions regarding GC.malloc.

When requesting a chunk of memory from GC.malloc am i right in assuming that this chunk is scanned for pointers to other GC resources in order to make decisions whether to collect them or not?

By default, yes, but you can use BlkAttr.NO_SCAN if you do not want that (eg, if you want to store integers). As a rule of thumb, you can use hasIndirections!T to know if or if not to scan (that's what most of phobos relies on).

What does BlkAttr.FINALIZE do when used in the GC.malloc call?

I have no idea. I think its for classes though, since we (currently) don't finalize structs anyways.

Reply via email to