CPPShift MemoryPool v2.1.0 #15
LessComplexity
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Changelog
Future Features
While developing using my MemoryPool, I decided to do some weird taboo and override the
new
anddelete
operators completely to use a global MemoryPool of the application. Then, I noticed that the pool just keeps filling up since memory is allocated and de-allocated almost randomly by libraries and the system, thus is not sequential as the pool likes it. Using the memory pool scope feature won't help me here - so I decided to add some garbage collection mechanism that keeps a linked chain of all free area in the pool that can be used for further allocation - this seemed to work great so I decided to add it to the library later.When I was developing a server application, that obviously requires to do work in parallel, I also had the Idea to override the
new
anddelete
operators to speed things up a little. This also required me to add changes to the memory pool, once it will be complete I will also add it to a dedicate release :)The garbage collection feature changes the header of SMemoryUnitHeader to a special header that indicates that the unit was deleted, and is pointing to the previous deleted element (this way the MemoryPool keeps track of all the available deleted data). In advanced garbage collection mode, we want the memory pool, when memory is released, to iterate the deleted units and merge the ones that are close to each other into single units. Accordingly, the freeing procedure will have more latency but will be more optimized for memory consumption while still keeping a speed up over regular memory allocations.
Discussion
Discussion is open about the algorithms used in the MemoryPool that can be affective and speed up the library even more. Personally, I have a couple of different ideas regarding the garbage collection of the pool that can come in different forms and performances and would love to hear your ideas too! :)
This discussion was created from the release CPPShift MemoryPool v2.1.0.
Beta Was this translation helpful? Give feedback.
All reactions