summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorhboehm <hboehm>2008-10-28 01:58:57 +0100
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:43 +0200
commit0366b73775a247462278322f06efff5ac4b0eed6 (patch)
tree75eb846205856ecbbb157698aeb17cfd085ac628 /malloc.c
parente637f6ab757ec031eefc2e07af254a4198f5da7a (diff)
2008-10-27 Hans Boehm <Hans.Boehm@hp.com> (Really Ivan Maidansky)
* thread_local_alloc.c, include/private/thread_local_alloc.h: Fix typos in comments. * finalize.c: Declare mark_procs and GC_register_finalizer_inner STATIC. * malloc.c (GC_free): Move size calculation below assertion.
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/malloc.c b/malloc.c
index 88d5619..3329760 100644
--- a/malloc.c
+++ b/malloc.c
@@ -405,8 +405,6 @@ GC_API void GC_CALL GC_free(void * p)
# endif
h = HBLKPTR(p);
hhdr = HDR(h);
- sz = hhdr -> hb_sz;
- ngranules = BYTES_TO_GRANULES(sz);
# if defined(REDIRECT_MALLOC) && \
(defined(GC_SOLARIS_THREADS) || defined(GC_LINUX_THREADS) \
|| defined(MSWIN32))
@@ -417,6 +415,8 @@ GC_API void GC_CALL GC_free(void * p)
if (0 == hhdr) return;
# endif
GC_ASSERT(GC_base(p) == p);
+ sz = hhdr -> hb_sz;
+ ngranules = BYTES_TO_GRANULES(sz);
knd = hhdr -> hb_obj_kind;
ok = &GC_obj_kinds[knd];
if (EXPECT((ngranules <= MAXOBJGRANULES), 1)) {