darwin-zones-assure-init.patch 695 B

1234567891011121314151617
  1. --- a/include/jemalloc/internal/jemalloc_internal_inlines_c.h (working tree)
  2. +++ b/include/jemalloc/internal/jemalloc_internal_inlines_c.h (index)
  3. @@ -254,8 +254,14 @@ malloc_initialized(void) {
  4. * fastpath supports ticker and profiling, both of which will also
  5. * tail-call to the slowpath if they fire.
  6. */
  7. +#if defined(JEMALLOC_ZONE)
  8. +extern void je_assure_zone_register();
  9. +#endif
  10. JEMALLOC_ALWAYS_INLINE void *
  11. imalloc_fastpath(size_t size, void *(fallback_alloc)(size_t)) {
  12. +#if defined(JEMALLOC_ZONE)
  13. + je_assure_zone_register();
  14. +#endif
  15. LOG("core.malloc.entry", "size: %zu", size);
  16. if (tsd_get_allocates() && unlikely(!malloc_initialized())) {
  17. return fallback_alloc(size);