diff options
author | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-09 04:19:43 +0000 |
---|---|---|
committer | amodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-11-09 04:19:43 +0000 |
commit | 65c893900204393820e27c713e1dbe1e220bdc26 (patch) | |
tree | 7eab9c6877586fed4f47ae3d7bbef376c29efdd3 /libvtv | |
parent | 5962bd2815af9402100ca4dced8c1944fc2d59e4 (diff) | |
download | gcc-65c893900204393820e27c713e1dbe1e220bdc26.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229985 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libvtv')
-rw-r--r-- | libvtv/ChangeLog | 5 | ||||
-rw-r--r-- | libvtv/vtv_malloc.cc | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/libvtv/ChangeLog b/libvtv/ChangeLog index 57fe850bff5..4f216ac7703 100644 --- a/libvtv/ChangeLog +++ b/libvtv/ChangeLog @@ -1,3 +1,8 @@ +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> * configure.tgt (aarch64*-*-linux): Enable. diff --git a/libvtv/vtv_malloc.cc b/libvtv/vtv_malloc.cc index ecd07eb709c..ea26b8245c3 100644 --- a/libvtv/vtv_malloc.cc +++ b/libvtv/vtv_malloc.cc @@ -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; } |