Make LowMemoryNotification object allocated (#281)
* Make LowMemoryNotification object allocated This makes a separate allocation for the callback object. This makes it easier for different callbacks to be used. * Add reserve_with_leftover to address_space The address_space now supports reserving for non-power of 2 allocations and the space that is used for rounding up is retained by the address_space. This means that we can more tightly pack the allocators internal objects.
This commit is contained in:
committed by
GitHub
parent
c082a331e2
commit
8840b386bc
@@ -70,9 +70,13 @@ namespace snmalloc
|
||||
*/
|
||||
struct PalNotificationObject
|
||||
{
|
||||
std::atomic<PalNotificationObject*> pal_next;
|
||||
std::atomic<PalNotificationObject*> pal_next = nullptr;
|
||||
|
||||
void (*pal_notify)(PalNotificationObject* self);
|
||||
|
||||
PalNotificationObject(void (*pal_notify)(PalNotificationObject* self))
|
||||
: pal_notify(pal_notify)
|
||||
{}
|
||||
};
|
||||
|
||||
/***
|
||||
|
||||
Reference in New Issue
Block a user