Thread: overloading operator new

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    13

    overloading operator new

    Hi !

    I've searched through 80+ messages of this boards, but I've found no answer.
    What is the syntax to overload operator new ? This is for a memory manager, so I'd like an operator new which is called exactly like the ordinary one, and which does the same thing, except that instead of using the standard routine to allocate the memory block, is uses my own Alloc routine, which I've already written.

    In particular, the constructors of the objects newed should be called, as with the ordinary operator new.

    Do you know any tutorial ? Else, could you post some code ? Thanks !

  2. #2
    Registered User
    Join Date
    Jun 2002
    Posts
    13
    I've searched "Overload operator new" in google and I've found many interresting papers ! I'm so sorry to have posted a question here, whereas the answer was so easy to find elsewhere. On the other hand, having unsuccesfully searched intensively on this forum, I didn't expect to find the answer on google ! Yet for my other question (on pointers), I've still no answer.

    Morglum

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Overloading operators
    By ugmusicbiz in forum C++ Programming
    Replies: 2
    Last Post: 02-13-2009, 01:41 PM
  2. unary operator overloading and classes
    By coletek in forum C++ Programming
    Replies: 9
    Last Post: 01-10-2009, 02:14 AM
  3. Overloading operator ==
    By anon in forum C++ Programming
    Replies: 4
    Last Post: 05-10-2006, 03:26 PM
  4. operator overloading
    By blue_gene in forum C++ Programming
    Replies: 6
    Last Post: 04-29-2004, 04:06 PM
  5. overloading
    By theLukerBoy in forum C++ Programming
    Replies: 6
    Last Post: 11-04-2002, 08:49 PM