Thread: Allocator

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    329

    Allocator

    Hi,

    I've been reading up on Allocators, but I am still unsure as to their exact function.

    Could anybody please offer a simple explanation as the internet resources I have found are not that clear to me.

    Thanks,

    Darren.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    An allocator controls how memory is allocated and freed, basically.
    The default allocator will use new[] and delete[]. You can make your own that uses different sources for allocation, if you wish. That is the basic idea anyway.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Feb 2009
    Posts
    329
    Thanks Elysia,

    That makes sense now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Semaphore design in slab allocator
    By claudiu in forum C Programming
    Replies: 1
    Last Post: 03-02-2010, 09:46 PM
  2. define max length for allocator
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 02-28-2008, 09:07 PM
  3. allocator implementation
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 02-28-2008, 05:39 AM
  4. Allocator
    By Scarvenger in forum C++ Programming
    Replies: 2
    Last Post: 01-08-2008, 10:30 AM
  5. storage allocator without malloc
    By lectrolux in forum C Programming
    Replies: 8
    Last Post: 05-07-2003, 05:43 AM