Skip to main content
gamedev.net
🔒 Locked

Allocators

Started by Toolmaker Aug 30, 2003 at 6:46 PM 2 replies 300+ views
Original Post
Toolmaker
Toolmaker
I am currently developing a MUD server. I usually use char *, or char[] when I need a string. But that is ugly, and very limited. So I kinda want to develop my own string class. As an issue I found, it the fact I need to allocate memory. I could resize when memory when a larger string is inserted, and don''t resize when a smaller one is inserted. However, I know the STL implementation of string uses allocators for it''s memory management. What are these allocators EXACTLY and how do they work? Toolmaker
-Earth is 98% full. Please delete anybody you can.
 
Sneftel
Sneftel
The default allocator on most implementations just uses new/delete, IIRC.

So, why exactly aren''t you using std::strings?


How appropriate. You fight like a cow.
Toolmaker
Toolmaker
Might sound stupid, I want to create my own string class. I am currently developing some default classes above pre-build stuff because I want to get more programming experience. I didn''t do alot of big projects, or highspeed code, so I am trying to get as much experience as possible.

Toolmaker



-Earth is 98% full. Please delete anybody you can.
 
dot
dot
quote:
Original post by Toolmaker
However, I know the STL implementation of string uses allocators for it's memory management. What are these allocators EXACTLY and how do they work?



Check out my article here
http://www.codeproject.com/useritems/allocator.asp

[edited by - dot on August 30, 2003 12:59:05 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.