Click here to Skip to main content
15,887,135 members
Articles / Programming Languages / C++

A Custom STL std::allocator Replacement Improves Performance

Rate me:
Please Sign up or sign in to vote.
5.00/5 (25 votes)
21 Jan 2024CPOL10 min read 85.6K   1.2K   41  
Protect against heap fragmentation faults and improve execution speed with a fixed block alternative to STL std::allocator
This article describes an STL-compatible allocator implementation that relies upon a fixed block allocator for dispensing and reclaiming memory. The new allocator prevents faults caused by a fragmented heap and offer consistent allocation/deallocation execution times. My goal with stl_allocator was eliminating memory faults. By simply employing an STL-compatible fixed block allocator opens up the possibility of using C++ Standard Template Library features on a project that otherwise may not have been possible.

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
I've been a professional software engineer for over 20 years. When not writing code, I enjoy spending time with the family, camping and riding motorcycles around Southern California.

Comments and Discussions