Q: Overload operator new/delete

Discussion in 'C++' started by Jakob Bieling, Aug 8, 2003.

  1. Hi,

    I am overloading the global operator new and delete to track allocations
    and find leaks, along with file name and line numbers. This is how I
    overloaded operator new:

    #define new new (__FILE__, __LINE__)

    Now the same will not work with operator delete. Is there a way to have
    the file name and line number passed to operator delete?

    Thanks
    --
    jb

    (replace y with x if you want to reply by e-mail)
    Jakob Bieling, Aug 8, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris E. Yoon
    Replies:
    2
    Views:
    385
    Michiel Salters
    Jul 23, 2003
  2. Piotre Ugrumov
    Replies:
    3
    Views:
    368
    Nick Hounsome
    Jan 25, 2004
  3. Jef Driesen
    Replies:
    1
    Views:
    500
    Gernot Frisch
    Jan 19, 2005
  4. Lighter
    Replies:
    6
    Views:
    642
    Alan Johnson
    Aug 10, 2006
  5. Ying-Chieh Liao

    function overload (not operator overload)

    Ying-Chieh Liao, Oct 11, 2004, in forum: Perl Misc
    Replies:
    3
    Views:
    248
    Sherm Pendley
    Oct 11, 2004
Loading...

Share This Page