summaryrefslogtreecommitdiff
path: root/mallocx.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2014-02-18 00:50:14 +0400
committerIvan Maidanski <ivmai@mail.ru>2014-02-21 01:15:08 +0400
commit34ce04c1c0ccf3b313b2449e58cd790cc75b3b29 (patch)
tree9439803a986da3670cc303efcf85ebe6aa7e16f3 /mallocx.c
parent14c09aef1ce4ac4e627f8d62e1c82e475844ded9 (diff)
downloadbdwgc-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 'mallocx.c')
-rw-r--r--mallocx.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mallocx.c b/mallocx.c
index a2d9c70e..de9fd931 100644
--- a/mallocx.c
+++ b/mallocx.c
@@ -52,20 +52,20 @@ STATIC void * GC_generic_or_special_malloc(size_t lb, int knd)
switch(knd) {
# ifdef STUBBORN_ALLOC
case STUBBORN:
- return(GC_malloc_stubborn((size_t)lb));
+ return GC_malloc_stubborn(lb);
# endif
case PTRFREE:
- return(GC_malloc_atomic((size_t)lb));
+ return GC_malloc_atomic(lb);
case NORMAL:
- return(GC_malloc((size_t)lb));
+ return GC_malloc(lb);
case UNCOLLECTABLE:
- return(GC_malloc_uncollectable((size_t)lb));
+ return GC_malloc_uncollectable(lb);
# ifdef ATOMIC_UNCOLLECTABLE
case AUNCOLLECTABLE:
- return(GC_malloc_atomic_uncollectable((size_t)lb));
+ return GC_malloc_atomic_uncollectable(lb);
# endif /* ATOMIC_UNCOLLECTABLE */
default:
- return(GC_generic_malloc(lb,knd));
+ return GC_generic_malloc(lb, knd);
}
}
@@ -177,7 +177,7 @@ GC_API void * GC_CALL GC_generic_malloc_ignore_off_page(size_t lb, int k)
DCL_LOCK_STATE;
if (SMALL_OBJ(lb))
- return(GC_generic_malloc((word)lb, k));
+ return GC_generic_malloc(lb, k);
lg = ROUNDED_UP_GRANULES(lb);
lb_rounded = GRANULES_TO_BYTES(lg);
if (lb_rounded < lb)
@@ -220,12 +220,12 @@ GC_API void * GC_CALL GC_generic_malloc_ignore_off_page(size_t lb, int k)
GC_API void * GC_CALL GC_malloc_ignore_off_page(size_t lb)
{
- return((void *)GC_generic_malloc_ignore_off_page(lb, NORMAL));
+ return GC_generic_malloc_ignore_off_page(lb, NORMAL);
}
GC_API void * GC_CALL GC_malloc_atomic_ignore_off_page(size_t lb)
{
- return((void *)GC_generic_malloc_ignore_off_page(lb, PTRFREE));
+ return GC_generic_malloc_ignore_off_page(lb, PTRFREE);
}
/* Increment GC_bytes_allocd from code that doesn't have direct access */