]> gcc.gnu.org Git - gcc.git/blobdiff - libvtv/vtv_malloc.cc
Correct libvtv obstack use
[gcc.git] / libvtv / vtv_malloc.cc
index ecd07eb709c429d9336e06b7514bfa6d13d9b1cf..ea26b8245c37873ebaa6e7eabcd50e6a94da0d67 100644 (file)
@@ -194,7 +194,7 @@ obstack_chunk_alloc (size_t size)
 }
 
 static void
-obstack_chunk_free (size_t)
+obstack_chunk_free (void *)
 {
   /* Do nothing. For our purposes there should be very little
      de-allocation. */
@@ -217,14 +217,13 @@ __vtv_malloc_init (void)
 #endif
     VTV_error ();
 
-  obstack_chunk_size (&vtv_obstack) = VTV_PAGE_SIZE;
-  obstack_alignment_mask (&vtv_obstack) = sizeof (long) - 1;
   /* We guarantee that the obstack alloc failed handler will never be
      called because in case the allocation of the chunk fails, it will
      never return */
   obstack_alloc_failed_handler = NULL;
 
-  obstack_init (&vtv_obstack);
+  obstack_specify_allocation (&vtv_obstack, VTV_PAGE_SIZE, sizeof (long),
+                             obstack_chunk_alloc, obstack_chunk_free);
   malloc_initialized = 1;
 }
 
This page took 0.025152 seconds and 5 git commands to generate.