diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2014-02-18 00:50:14 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2014-02-21 01:15:08 +0400 |
commit | 34ce04c1c0ccf3b313b2449e58cd790cc75b3b29 (patch) | |
tree | 9439803a986da3670cc303efcf85ebe6aa7e16f3 /malloc.c | |
parent | 14c09aef1ce4ac4e627f8d62e1c82e475844ded9 (diff) | |
download | bdwgc-34ce04c1c0ccf3b313b2449e58cd790cc75b3b29.tar.gz |
Remove redundant casts in GC_generic_or_special_malloc and similar
(refactoring)
* mallocx.c (GC_generic_or_special_malloc,
GC_generic_malloc_ignore_off_page): Remove redundant casts for
"lb" argument; remove redundant parentheses.
* fnlz_mlc.c (GC_finalized_malloc): Likewise.
* malloc.c (GC_generic_malloc, GC_malloc_uncollectable): Likewise.
* malloc.c (GC_malloc_uncollectable): Remove redundant cast of
returned value.
* mallocx.c (GC_malloc_ignore_off_page,
GC_malloc_atomic_ignore_off_page): Likewise.
Diffstat (limited to 'malloc.c')
-rw-r--r-- | malloc.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -179,7 +179,7 @@ GC_API void * GC_CALL GC_generic_malloc(size_t lb, int k) GC_DBG_COLLECT_AT_MALLOC(lb); if (SMALL_OBJ(lb)) { LOCK(); - result = GC_generic_malloc_inner((word)lb, k); + result = GC_generic_malloc_inner(lb, k); UNLOCK(); } else { size_t lg; @@ -312,15 +312,14 @@ GC_API void * GC_CALL GC_malloc_uncollectable(size_t lb) UNLOCK(); } else { UNLOCK(); - op = (ptr_t)GC_generic_malloc((word)lb, UNCOLLECTABLE); + op = GC_generic_malloc(lb, UNCOLLECTABLE); /* For small objects, the free lists are completely marked. */ } GC_ASSERT(0 == op || GC_is_marked(op)); - return((void *) op); } else { hdr * hhdr; - op = (ptr_t)GC_generic_malloc((word)lb, UNCOLLECTABLE); + op = GC_generic_malloc(lb, UNCOLLECTABLE); if (0 == op) return(0); GC_ASSERT(((word)op & (HBLKSIZE - 1)) == 0); /* large block */ @@ -337,8 +336,8 @@ GC_API void * GC_CALL GC_malloc_uncollectable(size_t lb) # endif hhdr -> hb_n_marks = 1; UNLOCK(); - return((void *) op); } + return op; } #ifdef REDIRECT_MALLOC |