From: Eric Wong Date: 2011-12-02T05:51:15+09:00 Subject: Re: GC.malloc_allocated_size and GC.malloc_allocations not available (#if CALC_EXACT_MALLOC_SIZE) I単aki Baz Castillo wrote: > So it seems that in my system CALC_EXACT_MALLOC_SIZE is not set since > gc.c file also contains: > > #define CALC_EXACT_MALLOC_SIZE 0 > > Why is it unavailable? Enabling that breaks any C extensions that (incorrectly) mix x{m,c,re}alloc() calls with regular free() and vice-versa. Even worse, this breakage isn't noticeable at build/compile time, so it's not easy to find/fix everywhere, especially if it's not in regular code paths. Maybe Ruby should have a alternative *alloc API that enforce this: (rb_emalloc, rb_ecalloc, rb_erealloc, rb_efree) and we can deprecate the x* one slowly without breaking existing extensions.