Thanx a ton Scott.I was really confused as to how to do it...
----- Original Message -----
From: "Scott Johnson (Bellevue)" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Sunday, July 22, 2001 11:13 PM
Subject: RE: to overload new operator...


> > From: Gaurav Palvia [mailto:[EMAIL PROTECTED]]
> > I m not using standard MSL ANSI C/C++  header files in my app.
> > So is there any way of overloading new without including <new>
> > in the source....
>
> Yes, no problem.  Just add a .cpp file like this to your project:
>
>     void * operator new ( unsigned long s )
>     {
>         void * p = my_favorite_allocator( s );
>         return p;
>     }
>
> Same for operator delete and the array versions.  Note usage of 'unsigned
> long' (or your favorite typedef for it) if typedef size_t isn't visible.
> The linker will do the right thing when it sees your local overloads.
>
> -slj-
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to