4 ms·
edit: actually xmalloc and xfree are defined as #define xmalloc ruby_xmalloc #define xfree ruby_xfree
by kristianp 10y ago
edit: actually xmalloc and xfree are defined as
#define xmalloc ruby_xmalloc
#define xfree ruby_xfree
- busterarm 10y agoThat's actually fascinating. I wonder if anyone has background on this...any comments I see are in Japanese.
- eudox 10y agoReplacing malloc/calloc/free etc an application-specific xmalloc/xcalloc/xfree is seemingly a fairly common pattern. There's one example in libiberty[0] (-liberty, get it?) where, for instance, the return value of malloc is checked for NULL and the program terminates if so. [0]: http://www.delorie.com/gnu/docs/gcc/libiberty_5.html http://www.delorie.com/gnu/docs/gcc/libiberty_5.html