Skip to content

Custom C++ String Pool Allocator, including benchmark code to compare vs. STL strings.

License

Notifications You must be signed in to change notification settings

GiovanniDicanio/StringPool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

StringPool

Custom C++ String Pool Allocator, including benchmark code to compare vs. STL strings.

by Giovanni Dicanio

Reusable code can be found in the StringPool.h header.

This repo constains a VS2015 solution; anyway, I wrote the C++ code to be cross-platform (e.g. there are no dependencies from <Windows.h> or other Windows-specific headers).

The basic idea of this custom string pool allocator is to allocate big chunks of memory, and then serve single string allocations carving memory from inside those blocks, with a simple fast pointer increase.

Moreover, the custom string class implemented to work with this allocator is very fast to sort as well, as it just contains a string pointer and a length data members, and its copy semantics is simple member-wise copy.

About

Custom C++ String Pool Allocator, including benchmark code to compare vs. STL strings.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages