Maximum memory which malloc can allocate

I was trying to figure out how much memory I can malloc to maximum extent on my machine (1 Gb RAM 160 Gb HD Windows platform). I read that the maximum memory malloc can allocate is limited to physical memory (on heap). Also when a program exceeds consumption of memory to a certain level, the … Read more

Why do my array of structs take up so much memory?

Question: How does the Micro Framework allocate memory for an array of structs? BitBucket repository with code to replicate. Context and Detail I’m making a queue using a fixed sized array to insert delays in processing keystrokes from a USB Keyboard. I’m using a struct to represent the key up and down events and the … Read more

Comparing STL strings that use different allocators

I’d like to compare STL strings that are allocated with different allocators, e.g. an ordinary std::string with a string using a custom STL allocator. Unfortunately, it seems that usual operator==() doesn’t work in this case: // Custom STL allocator to allocate char’s for string class typedef MyAllocator<char> MyCharAllocator; // Define an instance of this allocator … Read more