Commit 37697711 by Alan Modra Committed by Alan Modra

Correct libvtv obstack use

Fixes a compile error with both old and new obstacks due to
obstack_chunk_free having the wrong signature.  Also, setting chunk
size and alignment before obstack_init is pointless since they are
overwritten.

	* vtv_malloc.cc (obstack_chunk_free): Correct param type.
	(__vtv_malloc_init): Use obstack_specify_allocation.

From-SVN: r229985
parent c240b3e0
2015-11-09 Alan Modra <amodra@gmail.com>
* vtv_malloc.cc (obstack_chunk_free): Correct param type.
(__vtv_malloc_init): Use obstack_specify_allocation.
2015-10-20 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> 2015-10-20 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* configure.tgt (aarch64*-*-linux): Enable. * configure.tgt (aarch64*-*-linux): Enable.
......
...@@ -194,7 +194,7 @@ obstack_chunk_alloc (size_t size) ...@@ -194,7 +194,7 @@ obstack_chunk_alloc (size_t size)
} }
static void static void
obstack_chunk_free (size_t) obstack_chunk_free (void *)
{ {
/* Do nothing. For our purposes there should be very little /* Do nothing. For our purposes there should be very little
de-allocation. */ de-allocation. */
...@@ -217,14 +217,13 @@ __vtv_malloc_init (void) ...@@ -217,14 +217,13 @@ __vtv_malloc_init (void)
#endif #endif
VTV_error (); 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 /* We guarantee that the obstack alloc failed handler will never be
called because in case the allocation of the chunk fails, it will called because in case the allocation of the chunk fails, it will
never return */ never return */
obstack_alloc_failed_handler = NULL; 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; malloc_initialized = 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment