[Gc] Avoid GC_calloc-like semantics
lists at consulting.net.nz
Sat Jul 16 18:58:51 PDT 2005
Thank you for your wonderful garbage collector that works in very hostile
GC_malloc is closer to calloc's semantics since it guarantees that
allocated memory is cleared exactly like calloc. I have situations where I
need to duplicate non-atomic allocations. Ordinarily this would consist of
a malloc and a memcpy. Substituting GC_malloc for malloc leads to the
allocation first being cleared before it is instantly filled via memcpy.
Will you expose a non-atomic non-zeroing allocator as part of your public
API? I suggest the name GC_malloc_nonatomic_nonzero, which is scary enough
to stop people from using it before they understand its implications.
More information about the Gc