Closed therealdreg closed 1 year ago
Thanks. I'll try to mention this in the docs.
All STC containers except for linked lists can be preallocated with reserve(), and that includes sorted maps, queues and deques! This is uncommon, as in c++ these containers normally allocates elements (as node or segments) incrementally, and does not provide reserve.
ADD: In case you have a pool of memory already allocated, you can #define i_allocator pool
, before including and reserving space for each container. In this case you must have created the following function / macros:
Hello @tylov! I find this library to be quite impressive. For individuals like myself who program critical embedded systems, we must utilize deterministic code (+avoid heap fragmentation), which means we cannot employ malloc/calloc.
Typically, we resort to using "pools" and similar constructs, or allocate everything at the program's main.
I believe it would be beneficial to incorporate support for such scenarios.
I've reviewed your code, and several approaches come to mind. It would be valuable to document the most optimal method for this scenario (README)