overload operator new with a spcialized memory manager instance
I am trying to find a way to overload operator new of a class to use a
specialzied memory manager. In my design multiple memory managers exist. I
need to pass the instance of a memory manager into operator new. In ANSI C,
it is quite simple, like this:
type_t* ansi_c_init(MemoryManager* m)
type_t* a = (type_t*)->alloc_bytes(sizeof(type_t));
a->memory_manager = m;
According to my read, the new() overload is actually a static method and can
not call any members. So my question is, it is a backward in C++? Is it even
possible to customize memory allocation with a specialized memory manager?
|All times are GMT. The time now is 11:00 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.