Category : memory-management

While testing some things regarding page faults I discovered a curious difference between how new operates in Debug mode and Release mode in MSVC. Consider the following code1: #include <array> constexpr size_t PAGE_SIZE = 4096; int main() { const size_t count = 1000000; char* const mem = new char[PAGE_SIZE * count]; // page align the ..

Read more

I have a map structure as below which has shared_pointer of a protobuf structure Stats: map<string, shared_pointer<vol::proto::Stats> statsMap; I am storing and retrieving the map entries through a LRU cache implementation template class LRUCache<string, std::shared_ptr<vol::proto::Stats>>; Protobuf structure:- message Stats { required string oid = 1; required int64 logical_size = 2; required int64 committed_size = 3; ..

Read more

Apologies in advance if this turns out to be a stupid question… I have picked up a very old piece of c++ code that references MemReAlloc. Does this function exist in current visual-studio/windows and if so how do I get access to it, or has it been replaced by new memory management functions? I suspect ..

Read more