mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-10 07:47:26 +03:00
Pull the tcache-aware routing helpers out of arena into a layer that sits directly below the public malloc interface: arena_malloc -> malloc_dispatch_malloc arena_palloc -> malloc_dispatch_palloc arena_ralloc -> malloc_dispatch_ralloc arena_dalloc* -> malloc_dispatch_dalloc* arena_sdalloc* -> malloc_dispatch_sdalloc* arena_dalloc_promoted -> malloc_dispatch_dalloc_promoted The new module (malloc_dispatch.h, malloc_dispatch_inlines.h, src/malloc_dispatch.c) owns the tcache-vs-fall-through decision; the only consumer is jemalloc_internal_inlines_c.h. arena keeps a narrower arena_prof_demote() for the sampled-allocation demotion path.
19 lines
759 B
C
19 lines
759 B
C
#ifndef JEMALLOC_INTERNAL_MALLOC_DISPATCH_H
|
|
#define JEMALLOC_INTERNAL_MALLOC_DISPATCH_H
|
|
|
|
#include "jemalloc/internal/jemalloc_preamble.h"
|
|
#include "jemalloc/internal/tsd_types.h"
|
|
|
|
/* Forward decls; only used as pointer types below. */
|
|
typedef struct arena_s arena_t;
|
|
typedef struct tcache_s tcache_t;
|
|
|
|
void *malloc_dispatch_palloc(tsdn_t *tsdn, arena_t *arena, size_t usize,
|
|
size_t alignment, bool zero, bool slab, tcache_t *tcache);
|
|
void malloc_dispatch_dalloc_promoted(
|
|
tsdn_t *tsdn, void *ptr, tcache_t *tcache, bool slow_path);
|
|
void *malloc_dispatch_ralloc(tsdn_t *tsdn, arena_t *arena, void *ptr,
|
|
size_t oldsize, size_t size, size_t alignment, bool zero, bool slab,
|
|
tcache_t *tcache);
|
|
|
|
#endif /* JEMALLOC_INTERNAL_MALLOC_DISPATCH_H */
|