Designing and coding a non-fragmenting pool of static memory

I have heard this term before, and I would like to know how to design and code it.
Should I use an STL dispenser if one is available?
How can this be done on devices without an OS?
What are the tradeoffs between using it and using the regular malloc / new compiler?

+1
source share
2 answers

Let's try to describe what is mainly a memory pool - I just print it from my head, it has been a while since I implemented it, if something is clearly stupid, it's just a suggestion! :)

1. , , , . , . , (, , ). T.

"" , , , . . , .. "" ( T), , T a node , , T, , node . ! ( , ), .

, , , , , , , . ( , , new/delete T - , google - )

"", , T. , T . , ( , - , ).

, , , , , RC, , , , , !

2. STL , , , , - , , , .

3. - ( - HAL - ), , ?

4. malloc/new (google - , !). , , , , , , , malloc/free.

- -, ?

+2

, , , . std.

, , , . , , , , , , , STL.

, Hoard, , , , . , .

.

+3

Source: https://habr.com/ru/post/1775594/


All Articles