Find the answer to your Linux question:
Results 1 to 2 of 2
Can someone help me... I am looking for a way (in C/C++) to allocate dynamic memory on a specific heap. Ideally, I would like to create that heap or just ...
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Posts
    2

    Creating a Heap and Allocating memory on it???

    Can someone help me... I am looking for a way (in C/C++) to allocate dynamic memory on a specific heap. Ideally, I would like to create that heap or just acquire it from the current process.

    In a nutshell, I want to be able to do in Linux what I can do using the windows API functions (HeapAlloc, HeapFree, GetProcessHeap, and CreateHeap).

    I've looked around the documentation on glibc 2.7 and all around the web, and I could manage to find a solution to my problem. Does anyone know how to do this??

    As a context of application: I am building an application with multiple dynamic libraries which all share the same memory and need to be able to alloc/free dynamic memory at will on a shared heap. If anyone has suggestions on solving this problem, it's welcomed as well.

    thank you in advance,
    LordMikado

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    If you go to freshmeat.net and search for "memory allocation", you'll find memory allocation debugging tools (which you don't want, or at least didn't ask for), and memory allocation implementations (which you do want). If you like one of those packages and the package requires you to provide it with the memory that is to be organized into a heap, do that with malloc() or sbrk().

    Hope this helps.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...