Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > overload operator new with a spcialized memory manager instance

Reply
Thread Tools

overload operator new with a spcialized memory manager instance

 
 
Maximus
Guest
Posts: n/a
 
      08-27-2008
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?


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
function overload (not operator overload) Ying-Chieh Liao Perl Misc 3 10-11-2004 11:24 AM
New digital Gallrey - spcialized on Moving art =?ISO-8859-1?Q?K=FCnstler_Kar?= Digital Photography 0 12-15-2003 02:22 PM



Advertisments