Showing posts with label allocator. Show all posts
Showing posts with label allocator. Show all posts

Thursday, April 5, 2012

A Container that Uses an Allocator

In a previous post, I explained how to make your own allocators.  But one question still remains: how can I make a container that uses the amazing tools that are allocators?  Normally, a person would not worry about such things because the STL has almost every kind of container that will be needed, but it does lack a few; for example, an ordered dictionary is not part of the STL.

Tuesday, April 3, 2012

Standard Allocator Problems

As I have mentioned before, I do not consider myself an expert on allocators, but I do know a little about them.  In a previous post I explained their purpose, and in a future post I plan to show how to make your own container that uses them.  If I am not an expert, though, what qualifies me to express my concerns about a problem I think that I found in the C++ standard concerning allocators?  Well, starting the topic should be fine, but I think that I will leave the actual "do something about it" to somebody with more experience in such things.

Funky Memory

Allocators.  They are terrifying, difficult to understand, and easy to misunderstand.  They do not seem to be coded often, and few articles are written about them.  There is little to go on to figure out what exactly those handy little tools do or even how to use them.

I do not consider myself an expert on the topic, but I have read many articles, perused thousands of lines of code that uses them, and read the C++ standard1's sections about them. I am not an expert, but I know a little about allocators, and a little more information on the Web is much better than none at all!