mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-11 08:17:16 +03:00
Add batch allocation API
This commit is contained in:
parent
c6f59e9bb4
commit
978f830ee3
9 changed files with 329 additions and 2 deletions
|
|
@ -54,6 +54,7 @@ void arena_migrate(tsd_t *tsd, unsigned oldind, unsigned newind);
|
|||
void iarena_cleanup(tsd_t *tsd);
|
||||
void arena_cleanup(tsd_t *tsd);
|
||||
void arenas_tdata_cleanup(tsd_t *tsd);
|
||||
size_t batch_alloc(void **ptrs, size_t num, size_t size, int flags);
|
||||
void jemalloc_prefork(void);
|
||||
void jemalloc_postfork_parent(void);
|
||||
void jemalloc_postfork_child(void);
|
||||
|
|
|
|||
|
|
@ -229,6 +229,17 @@ prof_sample_aligned(const void *ptr) {
|
|||
return ((uintptr_t)ptr & PAGE_MASK) == 0;
|
||||
}
|
||||
|
||||
JEMALLOC_ALWAYS_INLINE bool
|
||||
prof_sampled(tsd_t *tsd, const void *ptr) {
|
||||
prof_info_t prof_info;
|
||||
prof_info_get(tsd, ptr, NULL, &prof_info);
|
||||
bool sampled = (uintptr_t)prof_info.alloc_tctx > (uintptr_t)1U;
|
||||
if (sampled) {
|
||||
assert(prof_sample_aligned(ptr));
|
||||
}
|
||||
return sampled;
|
||||
}
|
||||
|
||||
JEMALLOC_ALWAYS_INLINE void
|
||||
prof_free(tsd_t *tsd, const void *ptr, size_t usize,
|
||||
emap_alloc_ctx_t *alloc_ctx) {
|
||||
|
|
|
|||
|
|
@ -274,7 +274,6 @@ te_prof_sample_event_lookahead_surplus(tsd_t *tsd, size_t usize,
|
|||
|
||||
JEMALLOC_ALWAYS_INLINE bool
|
||||
te_prof_sample_event_lookahead(tsd_t *tsd, size_t usize) {
|
||||
assert(usize == sz_s2u(usize));
|
||||
return te_prof_sample_event_lookahead_surplus(tsd, usize, NULL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue