bumpalo icon indicating copy to clipboard operation
bumpalo copied to clipboard

Allocation limit

Open stepancheg opened this issue 3 years ago • 2 comments
trafficstars

Add an ability to limit the Bump size: if the number of allocated bytes exceeds the configured number, allocation should fail.

AFAIU, it is possible to make this feature with virtually no runtime overhead if the limit is checked only in alloc_layout_slow.

stepancheg avatar Dec 05 '21 21:12 stepancheg

I would be open to reviewing and merging a PR that implements this functionality.

We should also have quickchecks that set random allocation limits, allocate from the bump and assert that the allocation limits are respected.

fitzgen avatar Dec 06 '21 19:12 fitzgen

Hello! I tried my hand at implementing this feature, tell me what you think

Eliasin avatar Jun 02 '22 22:06 Eliasin