This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

replacing new, getting sane allocator/iostreams behavior



Carlo.

First of all, I suggest you filing a bug in GNATS about this.

> #include <iostream>
> 
> void* operator new(size_t size)
> {
>   static std::ios_base::Init dummy;
>   std::cout << "Calling operator new\n";
>   return malloc(size);
> }
> 
> int main(void)
> {
>   return 0;
> }

Your patch won't work: it disables the sync_with_stdio functionality, for 
starters. Also, with changes to the allocator class and other bits, I'm 
not quite sure this is possible. 

-benjamin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]