MichaelFabrizio / KeyVector

C++ memory bootstrapping library
MIT License
0 stars 0 forks source link

[Fixes] Set upper limits on user requested allocation size or allocation alignment. #13

Closed MichaelFabrizio closed 2 months ago

MichaelFabrizio commented 2 months ago

Currently, end users can instantiate the Pool allocator class like this:

Pool<ALLOCATION_SIZE, ALLOCATION_ALIGNMENT> pool;

This change simply hardcodes an upper limit such that:

ALLOCATION_SIZE <= 1 GiB

and

ALLOCATION_ALIGNMENT <= 4 KiB

This is an important step to (hopefully) prevent user error, and also lower problem complexity while I'm building.

If you truly need to raise either value above these limits, that should be fine, as long as common sense is exercised for these limiting values.