×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Oct 2004
    Location
    Tokyo,Japan
    Posts
    289

    Post Overloading all new and delete operators

    Hi guys,

    I am working on a small exercise to overload new and delete operator to keep track of what pointers are allocated and what are deleted.

    I am able to overload one form of new operator .

    TAny* operator new(TUint size )


    I need your suggestion on this exercise.

    I am planning to maintain a linked list of nodes containing what pointers are allocated with what size.

    on every delete i will search that node by pointer address and remove from the list and also deallocate that pointer.


    i am looking for your suggestions.


    kinldy share your experience with me.


    thanks and regards
    nEo

  2. #2
    Regular Contributor
    Join Date
    Oct 2004
    Location
    Tokyo,Japan
    Posts
    289

    Question Re: Overloading all new and delete operators

    oops !

    i am getting error while overloading new(ELeave)

    my function is

    TAny* operator new(TUint size,TLeave aLeave);


    the error as quoted from CodeWarrior IDE is
    -----------------------------------------------------------------------
    Error : object 'operator new(unsigned int, TLeave)' redefined
    MAIN.cpp line 101
    -----------------------------------------------------------------------

    looking forward for your suggestioins.

    regards
    nEo'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •