diff options
author | Josh Peterson <joshuap@unity3d.com> | 2020-06-11 20:58:43 +0300 |
---|---|---|
committer | Josh Peterson <joshuap@unity3d.com> | 2020-06-11 20:58:43 +0300 |
commit | d72985871cd7049d9ca9d5f589c50c97d2f7a67f (patch) | |
tree | 639ea2bec57daf60babf226a8f049faa715b405d | |
parent | 69182463c88050dd7dfb7e2a65b052db01a81769 (diff) |
Use a specific Emscripten allocator for Tinytiny-emscripten-allocator
This allocator allows the GC to use the same allocator as the rest of
Emscripten, to avoid unnecessary heap fragmentation. The Emscripten used
in full Unity doesn't have this feature yet, so we'll put this behind
a define that is only enabled for Tiny.
-rw-r--r-- | include/private/gcconfig.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index cbe3ae9e..242f0a0a 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -3591,6 +3591,9 @@ EXTERN_C_BEGIN # elif defined(HAIKU) ptr_t GC_haiku_get_mem(size_t bytes); # define GET_MEM(bytes) (struct hblk*)GC_haiku_get_mem(bytes) +# elif defined(EMSCRIPTEN_TINY) + void *emmalloc_memalign(size_t alignment, size_t size); +# define GET_MEM(bytes) (struct hblk*)emmalloc_memalign(GC_page_size, bytes) # else ptr_t GC_unix_get_mem(size_t bytes); # define GET_MEM(bytes) (struct hblk *)GC_unix_get_mem(bytes) |