summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2001-10-24 01:10:41 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2001-10-24 01:10:41 (GMT)
commit59f6076d7acfadb517038c53259cd60d4fcb2ba1 (patch)
treeeb011896001e9470e4d2a8a1890c814004aaafd7
parente2cb0b9e0d2bb7097aa8c593ab9af38cc7464a3f (diff)
downloadlpsm-59f6076d7acfadb517038c53259cd60d4fcb2ba1.zip
lpsm-59f6076d7acfadb517038c53259cd60d4fcb2ba1.tar.gz
lpsm-59f6076d7acfadb517038c53259cd60d4fcb2ba1.tar.bz2
lpsm-59f6076d7acfadb517038c53259cd60d4fcb2ba1.tar.xz
Work around what seems to be a gcc bug.
-rw-r--r--malloc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/malloc.c b/malloc.c
index 6eb8aac..1ded3e5 100644
--- a/malloc.c
+++ b/malloc.c
@@ -237,8 +237,9 @@ static struct slab_header *lpsm_make_new_slab(struct slab_info *si, int index)
}
si->total_pages++;
+ si->list = sh;
- return (si->list = sh);
+ return sh;
}
void *lpsm_malloc_slab(size_t size)
@@ -270,9 +271,12 @@ void *lpsm_malloc_slab(size_t size)
sh = si->list;
if ( !sh ) {
/* Empty free list, need a new page */
- if ( !(sh = lpsm_make_new_slab(si,index)) )
+ sh = lpsm_make_new_slab(si,index);
+ if ( !sh ) {
+ DPRINTF(("slab: lpsm_make_new_slab() returned NULL, failed\n"));
errno = ENOMEM;
return NULL; /* Unavailable to allocate new slab */
+ }
}
/* It *better* be the same kind of slab... */