PAI/SEC: Add a dalloc_batch function.

This lets the SEC flush all of its items in a single call, rather than flushing
everything at once.
This commit is contained in:
David Goldblatt
2021-01-04 18:40:27 -08:00
committed by David Goldblatt
parent 4b8870c7db
commit f47b4c2cd8
11 changed files with 69 additions and 11 deletions

View File

@@ -13,6 +13,8 @@ struct pai_s {
bool (*shrink)(tsdn_t *tsdn, pai_t *self, edata_t *edata,
size_t old_size, size_t new_size);
void (*dalloc)(tsdn_t *tsdn, pai_t *self, edata_t *edata);
void (*dalloc_batch)(tsdn_t *tsdn, pai_t *self,
edata_list_active_t *list);
};
/*
@@ -42,4 +44,16 @@ pai_dalloc(tsdn_t *tsdn, pai_t *self, edata_t *edata) {
self->dalloc(tsdn, self, edata);
}
static inline void
pai_dalloc_batch(tsdn_t *tsdn, pai_t *self, edata_list_active_t *list) {
return self->dalloc_batch(tsdn, self, list);
}
/*
* An implementation of batch deallocation that simply calls dalloc once for
* each item in the list.
*/
void pai_dalloc_batch_default(tsdn_t *tsdn, pai_t *self,
edata_list_active_t *list);
#endif /* JEMALLOC_INTERNAL_PAI_H */