From 3186144dd72b884bb5a664c1830e91040ff911cf Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 17 Oct 2012 21:58:38 +0400 Subject: [PATCH] Minor code refactoring of GC_allochblk_nth * allchblk.c (GC_allochblk_nth): Simplify code in the loop (which allocates and drops the block in small chunks) by first calling GC_install_header if h != hbp (instead of calling it a conditional expression) and, then, calling setup_header if hhdr is non-NULL. --- allchblk.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/allchblk.c b/allchblk.c index 4a13de4a..b4879389 100644 --- a/allchblk.c +++ b/allchblk.c @@ -751,11 +751,12 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, int may_split) GC_bytes_dropped += total_size; GC_remove_from_fl_at(hhdr, n); for (h = hbp; (word)h < (word)limit; h++) { - if (h == hbp || 0 != (hhdr = GC_install_header(h))) { - (void) setup_header( - hhdr, h, - HBLKSIZE, - PTRFREE, 0); /* Can't fail */ + if (h != hbp) { + hhdr = GC_install_header(h); + } + if (NULL != hhdr) { + (void)setup_header(hhdr, h, HBLKSIZE, PTRFREE, 0); + /* Can't fail. */ if (GC_debugging_started) { BZERO(h, HBLKSIZE); } -- 2.49.0