]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Enable valgrind checking of vex (ugly hack).
authorJulian Seward <jseward@acm.org>
Wed, 7 Jul 2004 12:00:42 +0000 (12:00 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 7 Jul 2004 12:00:42 +0000 (12:00 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@59

VEX/priv/main/vex_util.c
VEX/test_main.c

index 055f1d365829d164e93096e9bc0e26688a7a0984..1c91ab852188d08bed0491cb289b759e1562534a 100644 (file)
@@ -42,14 +42,20 @@ void* LibVEX_Alloc ( Int nbytes )
 {
    vassert(vex_initdone);
    vassert(nbytes > 0);
-   nbytes = (nbytes + 7) & ~7;
-   if (storage_used + nbytes > N_STORAGE_BYTES)
-      vpanic("VEX storage exhausted.\n"
-             "Increase N_STORAGE_BYTES and recompile.");
-   storage_count_allocs++;
-   storage_bytes_allocd += nbytes;
-   storage_used += nbytes;
-   return (void*)(&storage[storage_used - nbytes]);
+   if (vex_valgrind_support) {
+      /* ugly hack */
+      extern void* malloc ( int );
+      return malloc(nbytes);
+   } else {
+      nbytes = (nbytes + 7) & ~7;
+      if (storage_used + nbytes > N_STORAGE_BYTES)
+         vpanic("VEX storage exhausted.\n"
+                "Increase N_STORAGE_BYTES and recompile.");
+      storage_count_allocs++;
+      storage_bytes_allocd += nbytes;
+      storage_used += nbytes;
+      return (void*)(&storage[storage_used - nbytes]);
+   }
 }
 
 /* Exported to library client. */
index 0e1e20042ac928630c372daeee8f2e26222fe93c..95e1717b8b4bbd31df842e2a31fdfa3132a88373 100644 (file)
@@ -61,7 +61,7 @@ int main ( int argc, char** argv )
    }
 
    LibVEX_Init ( &failure_exit, &log_bytes, 
-                 1, 1, False, 100 );
+                 1, 1, True, 100 );
 
    while (!feof(f)) {
       fgets(linebuf, N_LINEBUF,f);