[rfc] Provide separate operator vector new and delete in msvcrt; let valgrind check them
dank at kegel.com
Tue Dec 15 09:11:54 CST 2009
First draft for discussion. Not, um, well tested yet.
ANSI C++ mandates separate vector versions of new and delete
that do the same thing as the non-vector versions, but which can
be replaced by user apps (see
So far, so good; wine does that in msvcrt.
However, once in a while, a programmer will call delete when he
should have called delete, and a bunch of destructors won't
get called. To detect this programming error, let's split
the vector new and delete functions off from their scalar twins,
and add values for the heap function flags so we can inform
valgrind what kind of blocks are being wrangled.
This means picking two flag bits that Microsoft doesn't use;
there seem to be enough to go around.
Requires the corresponding patch to valgrind
Thanks to Steve Vandebogart for his help on this; he wrote a bunch of it.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2589 bytes
Desc: not available
More information about the wine-devel