Changeset View
Changeset View
Standalone View
Standalone View
src/support/lockedpool.h
Show First 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | public: | ||||
* you can only instantiate this with LockedPool(std::move(...)). | * you can only instantiate this with LockedPool(std::move(...)). | ||||
* | * | ||||
* The second argument is an optional callback when locking a newly | * The second argument is an optional callback when locking a newly | ||||
* allocated arena failed. If this callback is provided and returns false, | * allocated arena failed. If this callback is provided and returns false, | ||||
* the allocation fails (hard fail), if it returns true the allocation | * the allocation fails (hard fail), if it returns true the allocation | ||||
* proceeds, but it could warn. | * proceeds, but it could warn. | ||||
*/ | */ | ||||
LockedPool(std::unique_ptr<LockedPageAllocator> allocator, | LockedPool(std::unique_ptr<LockedPageAllocator> allocator, | ||||
LockingFailed_Callback lf_cb_in = 0); | LockingFailed_Callback lf_cb_in = nullptr); | ||||
~LockedPool(); | ~LockedPool(); | ||||
/** | /** | ||||
* Allocate size bytes from this arena. | * Allocate size bytes from this arena. | ||||
* Returns pointer on success, or 0 if memory is full or the application | * Returns pointer on success, or 0 if memory is full or the application | ||||
* tried to allocate 0 bytes. | * tried to allocate 0 bytes. | ||||
*/ | */ | ||||
void *alloc(size_t size); | void *alloc(size_t size); | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |