new. Not fixed yet.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@294
bt_everything.c bt_literal.c \
pth_threadpool.c pth_specific.c pth_mutexspeed.c malloc3.c \
pth_once.c weirdioctl.c pth_signal1.c pth_signal2.c \
- discard.c pth_semaphore1.c
+ discard.c pth_semaphore1.c new_override.cpp
--- /dev/null
+#include <stdlib.h>
+#include <stdio.h>
+
+class Test {
+public:
+ int a, b, c, d;
+};
+
+void *operator new(size_t size)
+{
+ void *ret = malloc(size);
+ printf("Here.\n");
+ for (unsigned int i = 0; i < size; i++) ((char *) ret)[i] = 0xFF;
+ return ret;
+}
+
+int main(int argc, char *argv[]) {
+ Test *toto;
+ int i;
+ int j = 0;
+
+ toto = new Test[2];
+
+ for (i = 0; i < 2; i++) {
+ if (toto[i].a) {
+ j++;
+ }
+ printf("%d : %08x %08x %08x %08x\n", i, toto[i].a, toto[i].b, toto[i].c, toto[i].d);
+ }
+}