diff options
Diffstat (limited to 'sal/rtl/source/alloc_arena.c')
-rw-r--r-- | sal/rtl/source/alloc_arena.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sal/rtl/source/alloc_arena.c b/sal/rtl/source/alloc_arena.c index b06366427f33..571d6de7d1d0 100644 --- a/sal/rtl/source/alloc_arena.c +++ b/sal/rtl/source/alloc_arena.c @@ -37,6 +37,8 @@ #include <string.h> #include <stdio.h> +extern AllocMode alloc_mode; + /* ================================================================= * * * arena internals. @@ -999,6 +1001,9 @@ SAL_CALL rtl_arena_alloc ( if ((arena != 0) && (pSize != 0)) { + if (alloc_mode == AMode_SYSTEM) + return rtl_allocateMemory(*pSize); + sal_Size size = RTL_MEMORY_ALIGN((*pSize), arena->m_quantum); if (size > arena->m_qcache_max) { @@ -1072,6 +1077,12 @@ SAL_CALL rtl_arena_free ( { if (arena != 0) { + if (alloc_mode == AMode_SYSTEM) + { + rtl_freeMemory(addr); + return; + } + size = RTL_MEMORY_ALIGN(size, arena->m_quantum); if (size > arena->m_qcache_max) { |