:Where is operator new[] & operator delete[]

:Where is operator new[] & operator delete[]

Post by Kin Cha » Thu, 05 Jun 1997 04:00:00



Hi,
        Can anyone tell me where I can find the source for operator new[] and
operator delete[] in MSL? I looked for them in new.cp and found that
they are commented out. The reason I'm asking is because I'm writing my
own global new, and wondering if the operator new[] will automatically
use my operator new, or if it has some internal algorithm that does not
depend on operator new.

Thanks

Kin Chan

 
 
 

:Where is operator new[] & operator delete[]

Post by MW R » Thu, 05 Jun 1997 04:00:00



>Hi,
>        Can anyone tell me where I can find the source for operator new[] and
>operator delete[] in MSL? I looked for them in new.cp and found that
>they are commented out. The reason I'm asking is because I'm writing my
>own global new, and wondering if the operator new[] will automatically
>use my operator new, or if it has some internal algorithm that does not
>depend on operator new.

new.cp  has

#ifndef OPERATOR_NEW
#define OPERATOR_NEW operator new
#endif
#ifndef OPERATOR_DELETE
#define OPERATOR_DELETE operator delete
#endif

then later on it has the overloaded OPERATOR_NEW and OPERATOR_DELETE defined.

Ron

--
     METROWERKS                                   Ron Liechty


 
 
 

:Where is operator new[] & operator delete[]

Post by Kin Cha » Thu, 05 Jun 1997 04:00:00




> new.cp  has

> #ifndef OPERATOR_NEW
> #define OPERATOR_NEW operator new
> #endif
> #ifndef OPERATOR_DELETE
> #define OPERATOR_DELETE operator delete
> #endif

> then later on it has the overloaded OPERATOR_NEW and OPERATOR_DELETE defined.

> Ron

> --
>      METROWERKS                                   Ron Liechty


Yeah, I know, but where are new[] and delete[]?
 
 
 

:Where is operator new[] & operator delete[]

Post by MW R » Sun, 08 Jun 1997 04:00:00



>Yeah, I know, but where are new[] and delete[]?

You can not overload new[] and delete[] with Metrowerks CodeWarrior C++.

Ron

--
     METROWERKS                                   Ron Liechty

 
 
 

:Where is operator new[] & operator delete[]

Post by Xavier Humbe » Mon, 09 Jun 1997 04:00:00



> You can not overload new[] and delete[] with Metrowerks CodeWarrior C++.

So, what means :

Quote:> //
> //    allow user definitions of operator new/delete
> //
> extern                void *operator new(size_t size);
> #pragma overload  void *operator new(size_t size);

> extern                void operator delete(void *);
> #pragma overload  void operator delete(void *);

in New.cp ???

Xav

-----------------------------------------------------------------------
Xavier HUMBERT                                    X H   S O F T W A R E


 
 
 

:Where is operator new[] & operator delete[]

Post by MW R » Tue, 10 Jun 1997 04:00:00





>> You can not overload new[] and delete[] with Metrowerks CodeWarrior C++.

>So, what means :

>> //
>> //    allow user definitions of operator new/delete
>> //
>> extern                void *operator new(size_t size);
>> #pragma overload  void *operator new(size_t size);

>> extern                void operator delete(void *);
>> #pragma overload  void operator delete(void *);

>in New.cp ???

new[] and delete[] are not implemented at this point, the compiler is
using the regular new/delete operators to allocate/free arrays.

Ron

--
     METROWERKS                                   Ron Liechty