C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28649
Number of posts: 94665

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Memory Pool & char array Posted by ghostfacelz on 10 May 2011 at 2:43 PM
Hi,
I was recently assigned a project and I'm looking for a little advice.
I have to implement a memory manager that has a char array for a memory pool.
So what I have concepted out was to segment the pool up into variable sized chunks, using the begining of the mempool to hold the location of the chunks as well as if they are being used.
I think its a fairly good solution as the conditions are that no other static or global variable may be created (the reason I went with this route was the hint that if we need to save data, we need to make it fit in the pool)

In any case on to my questions...
1)Anyone have any experience with variable pools, and would this approach theoretically work? I wouldnt want to get a day or two into it and hit a major design flaw that requires scrapping the whole project.

2)Can a character array store addresses of other portions of the same array, if so, can you offer some suggested reading on how to go about doing so (syntax-wise)?

Any advice would be greatly appreciated!!

Thanks!
-G
=Ghost=>



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.