Hi Jonathan, > I think this would be an improvement, although I still can't get the > assertion to fail:
Probably because the memory is still initialized to zero, when it is used for the first time. Try this: #include <stdlib.h> #include <string.h> #include <assert.h> struct A { A() {} void* operator new(size_t s) { void* ptr = malloc(s); memset(ptr, 0xFF, s); return ptr; } void operator delete(void* ptr) { free(ptr); } int value; }; int main() { A* a = new A; assert(a->value == -1); /* Use of uninitialized value */ delete a; } Bernd.