From 96528396064e8fef757b095957fd6c527d9ac78c Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 3 Aug 2017 11:54:58 +0100 Subject: [PATCH] gslice: Fix inline delarations in GSlice Accidentally introduced in commit 5cddde1fb2b8466d8104595008eafabd0728de5d. Signed-off-by: Philip Withnall --- glib/gslice.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/glib/gslice.c b/glib/gslice.c index 8be5bad48..6ff3597bb 100644 --- a/glib/gslice.c +++ b/glib/gslice.c @@ -1273,13 +1273,18 @@ allocator_add_slab (Allocator *allocator, ChunkLink *chunk; SlabInfo *sinfo; gsize addr, padding, n_chunks, color = 0; - gsize page_size = allocator_aligned_page_size (allocator, SLAB_BPAGE_SIZE (allocator, chunk_size)); + gsize page_size; int errsv; - /* allocate 1 page for the chunks and the slab */ - gpointer aligned_memory = allocator_memalign (page_size, page_size - NATIVE_MALLOC_PADDING); - errsv = errno; - guint8 *mem = aligned_memory; + gpointer aligned_memory; + guint8 *mem; guint i; + + page_size = allocator_aligned_page_size (allocator, SLAB_BPAGE_SIZE (allocator, chunk_size)); + /* allocate 1 page for the chunks and the slab */ + aligned_memory = allocator_memalign (page_size, page_size - NATIVE_MALLOC_PADDING); + errsv = errno; + mem = aligned_memory; + if (!mem) { const gchar *syserr = strerror (errsv);