This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Malloc

How do i use the 'malloc' function.

Can someone give me an example..

Thanks in advance...

Parents
  • A slightly simpler way is to have a system with fixed size(say 256 bytes) blocks available.
    The something like 'void* getblock()'/'void free(void*)' can be implemented.
    The memory manager routines then can keep track of these block with a bitmap for exeample (free/used).
    The application of course has to be written with this in mind.




    Taking your example of setting 256 bytes. How do I go about setting it using the void *getblock() and void free(void*) function..

    Thanks..

Reply
  • A slightly simpler way is to have a system with fixed size(say 256 bytes) blocks available.
    The something like 'void* getblock()'/'void free(void*)' can be implemented.
    The memory manager routines then can keep track of these block with a bitmap for exeample (free/used).
    The application of course has to be written with this in mind.




    Taking your example of setting 256 bytes. How do I go about setting it using the void *getblock() and void free(void*) function..

    Thanks..

Children
No data