mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-25 16:43:33 +03:00
Add a batch allocation interface to the PAI.
For now, no real allocator actually implements this interface; this will change in subsequent diffs.
This commit is contained in:
parent
bf448d7a5a
commit
480f3b11cd
6 changed files with 59 additions and 1 deletions
13
src/pai.c
13
src/pai.c
|
|
@ -1,6 +1,19 @@
|
|||
#include "jemalloc/internal/jemalloc_preamble.h"
|
||||
#include "jemalloc/internal/jemalloc_internal_includes.h"
|
||||
|
||||
size_t
|
||||
pai_alloc_batch_default(tsdn_t *tsdn, pai_t *self, size_t size,
|
||||
size_t nallocs, edata_list_active_t *results) {
|
||||
for (size_t i = 0; i < nallocs; i++) {
|
||||
edata_t *edata = pai_alloc(tsdn, self, size, PAGE,
|
||||
/* zero */ false);
|
||||
if (edata == NULL) {
|
||||
return i;
|
||||
}
|
||||
edata_list_active_append(results, edata);
|
||||
}
|
||||
return nallocs;
|
||||
}
|
||||
|
||||
void
|
||||
pai_dalloc_batch_default(tsdn_t *tsdn, pai_t *self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue