This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
replacing new, getting sane allocator/iostreams behavior
- To: Carlo Wood <carlo at alinoe dot com>
- Subject: replacing new, getting sane allocator/iostreams behavior
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Tue, 3 Jul 2001 18:03:51 -0700 (PDT)
- cc: libstdc++ at gcc dot gnu dot org
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