summaryrefslogtreecommitdiff
path: root/mallocx.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-02-08 11:41:45 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-02-08 11:41:45 +0300
commite794f1e7a4ef7ebd14621473420010c0db210235 (patch)
tree92902c12883ac3a8904f8d2e89bf3eccd431981c /mallocx.c
parent5df7ef6c0786f3cd9b7c3208055ada6d688a0692 (diff)
downloadbdwgc-e794f1e7a4ef7ebd14621473420010c0db210235.tar.gz
Change type of hb_sz field (of hblkhdr) from size_t to word
This is needed to make the size of hb_sz to be the same as of AO_t. * allchblk.c [USE_MUNMAP] (GC_unmap_old): Cast hhdr->hb_sz to size_t when passed to GC_unmap(). * allchblk.c (GC_allochblk_nth): Cast hhdr->hb_sz to signed_word when assigned to size_avail. * allchblk.c [USE_MUNMAP] (GC_allochblk_nth): Cast hhdr->hb_sz to size_t when passed to GC_remap(). * alloc.c (GC_set_fl_marks, GC_clear_fl_marks): Change type of sz and bit_no local variables from size_t/unsigned to word. * dbg_mlc.c (GC_check_heap_block): Likewise. * backgraph.c [MAKE_BACK_GRAPH] (per_object_helper): Cast hhdr->hb_sz to size_t; change type of i local variables from int to size_t. * checksums.c [CHECKSUMS] (GC_on_free_list): Change type of sz local variable from size_t to word. * mark.c (GC_push_marked, GC_push_unconditionally, GC_block_was_dirty): Likewise. * reclaim.c (GC_reclaim_small_nonempty_block, GC_disclaim_and_reclaim_or_free_small_block, GC_reclaim_block, GC_n_set_marks): Likewise. * checksums.c [CHECKSUMS] (GC_add_block): Remove bytes local variable (to avoid casting of hhdr->hb_sz). * dbg_mlc.c (GC_debug_free): Change type of i and obj_sz local variables from size_t to word. * dbg_mlc.c (GC_check_leaked): Likewise. * extra/pcr_interface.c (GC_enumerate_block): Change type of sz local variable from int to size_t. * extra/pcr_interface.c (GC_enumerate_block): Cast hhdr->hb_sz to size_t when assigned to sz. * mallocx.c (GC_realloc): Likewise. * mark.c (GC_set_hdr_marks): Likewise. * reclaim.c (GC_do_enumerate_reachable_objects): Likewise. * include/private/gc_pmark.h [MARK_BIT_PER_OBJ] (PUSH_CONTENTS_HDR): Cast hhdr->hb_sz to size_t in assignment of obj_displ. * include/private/gc_priv.h (struct hblkhdr): Change type of hb_sz from size_t to word. * include/private/gc_priv.h (MARK_BIT_NO): Cast offset argument to word instead of unsigned. * malloc.c (GC_free): Cast hhdr->hb_sz to size_t. * mallocx.c (GC_get_kind_and_size): Likewise. * mark.c (GC_clear_hdr_marks): Likewise. * misc.c (GC_size): Likewise. * misc.c (GC_do_blocking): Remove redundant cast of hhdr->hb_sz. * reclaim.c (GC_reclaim_clear, GC_reclaim_uninit, GC_disclaim_and_reclaim, GC_continue_reclaim): Change type of sz argument from size_t to word. * typd_mlc.c (GC_array_mark_proc): Change type of sz and nwords local variables from size_t to word.
Diffstat (limited to 'mallocx.c')
-rw-r--r--mallocx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mallocx.c b/mallocx.c
index 6440311d..5d42392f 100644
--- a/mallocx.c
+++ b/mallocx.c
@@ -52,7 +52,7 @@ GC_API int GC_CALL GC_get_kind_and_size(const void * p, size_t * psize)
hdr * hhdr = HDR(p);
if (psize != NULL) {
- *psize = hhdr -> hb_sz;
+ *psize = (size_t)hhdr->hb_sz;
}
return hhdr -> hb_obj_kind;
}
@@ -112,7 +112,7 @@ GC_API void * GC_CALL GC_realloc(void * p, size_t lb)
}
h = HBLKPTR(p);
hhdr = HDR(h);
- sz = hhdr -> hb_sz;
+ sz = (size_t)hhdr->hb_sz;
obj_kind = hhdr -> hb_obj_kind;
orig_sz = sz;