summaryrefslogtreecommitdiff
path: root/malloc.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-07-26 18:30:36 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 18:30:36 +0200
commit3c50a689ca85f4fe56afbc8da9e894c4cc3af845 (patch)
tree63fc7287fe3951a51b0490573d097e3b899d8dca /malloc.c
parent15a8bd002db68408468ee450c09f7af3975782e8 (diff)
gc7.0alpha5 tarball importgc7_0alpha5
Diffstat (limited to 'malloc.c')
-rw-r--r--malloc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/malloc.c b/malloc.c
index a36956a..1513735 100644
--- a/malloc.c
+++ b/malloc.c
@@ -215,14 +215,14 @@ void * GC_generic_malloc(size_t lb, int k)
if(SMALL_OBJ(lb)) {
lg = GC_size_map[lb];
opp = &(GC_aobjfreelist[lg]);
- FASTLOCK();
- if( EXPECT(!FASTLOCK_SUCCEEDED() || (op = *opp) == 0, 0) ) {
- FASTUNLOCK();
+ LOCK();
+ if( EXPECT((op = *opp) == 0, 0) ) {
+ UNLOCK();
return(GENERAL_MALLOC((word)lb, PTRFREE));
}
*opp = obj_link(op);
GC_bytes_allocd += GRANULES_TO_BYTES(lg);
- FASTUNLOCK();
+ UNLOCK();
return((void *) op);
} else {
return(GENERAL_MALLOC((word)lb, PTRFREE));
@@ -244,9 +244,9 @@ void * GC_generic_malloc(size_t lb, int k)
if(SMALL_OBJ(lb)) {
lg = GC_size_map[lb];
opp = (void **)&(GC_objfreelist[lg]);
- FASTLOCK();
- if( EXPECT(!FASTLOCK_SUCCEEDED() || (op = *opp) == 0, 0) ) {
- FASTUNLOCK();
+ LOCK();
+ if( EXPECT((op = *opp) == 0, 0) ) {
+ UNLOCK();
return(GENERAL_MALLOC((word)lb, NORMAL));
}
/* See above comment on signals. */
@@ -258,7 +258,7 @@ void * GC_generic_malloc(size_t lb, int k)
*opp = obj_link(op);
obj_link(op) = 0;
GC_bytes_allocd += GRANULES_TO_BYTES(lg);
- FASTUNLOCK();
+ UNLOCK();
return op;
} else {
return(GENERAL_MALLOC(lb, NORMAL));