CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2011

    Memory Pool Manager Problem

    Hello everyone,

    Recently I have been asked to write up a memory manager, something I've never done. They gave me the header file that had no virtual functions and I couldn't make any changes to. The source file had a const int called POOLSIZE and a char array called pool which was the size of POOLSIZE. I couldn't add anymore static or global variables and any information I needed to save had to be within the pool. The main they sent allocated size of a long and 255 bytes for a string. What bothers me is they also said the numbers should be close to 65530 before allocating memory and 65483 after the memory was allocated. That's 47 byte difference for 263 bytes that was actually requested. POOLSIZE is also set to equal 65536 within the source so the first 6 bytes were used for something. Am I missing something here or is there some sort of trick I'm unaware of? Maybe, I'm just reading to much into this. Anyways, if you have any ideas on the subject I'm very interested in what everyone here thinks. And if anyone could point me in the right direction to solve this problem that would be great. Thank you.

    P.S: Allocations are variable size and couldn't use functions that dynamically allocated memory during the program's execution.

  2. #2
    Join Date
    Jun 2011

    Re: Memory Pool Manager Problem

    Sorry I meant 259 bytes that were requested.

Tags for this Thread

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.