roken: Use a common allocator for all windows

Windows applications become very unhappy when memory is allocated
in one module (exe or dll) and deallocated in another.  This is
because each of the C run time library instances uses its own
heap.  Mixing allocating in one heap and deallocating in another
will lead to memory leaks and heap corruption.   For modules that
build against roken avoid this problem by sharing roken's allocator
with the module that uses it.

Change-Id: I31e35c600a78350b168a281811160696dc327544
This commit is contained in:
Jeffrey Altman
2012-07-01 22:03:32 -04:00
parent 7de08cd5d0
commit 3fe5572840
4 changed files with 84 additions and 0 deletions

View File

@@ -36,6 +36,7 @@
#include <stdlib.h>
#include "roken.h"
#undef realloc
ROKEN_LIB_FUNCTION void * ROKEN_LIB_CALL
rk_realloc(void *ptr, size_t size)