summaryrefslogtreecommitdiff
path: root/allchblk.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 /allchblk.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 'allchblk.c')
-rw-r--r--allchblk.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/allchblk.c b/allchblk.c
index c8d03b19..010fb8a5 100644
--- a/allchblk.c
+++ b/allchblk.c
@@ -413,7 +413,7 @@ GC_INNER void GC_unmap_old(void)
/* truncated counter value wrapping is handled correctly). */
if ((unsigned short)(GC_gc_no - hhdr->hb_last_reclaimed) >
(unsigned short)GC_unmap_threshold) {
- GC_unmap((ptr_t)h, hhdr -> hb_sz);
+ GC_unmap((ptr_t)h, (size_t)hhdr->hb_sz);
hhdr -> hb_flags |= WAS_UNMAPPED;
}
}
@@ -680,7 +680,7 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, int may_split)
if (NULL == hbp) return NULL;
GET_HDR(hbp, hhdr); /* set hhdr value */
- size_avail = hhdr->hb_sz;
+ size_avail = (signed_word)hhdr->hb_sz;
if (size_avail < size_needed) continue;
if (size_avail != size_needed) {
if (!may_split) continue;
@@ -728,7 +728,7 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, int may_split)
/* Make sure it's mapped before we mangle it. */
# ifdef USE_MUNMAP
if (!IS_MAPPED(hhdr)) {
- GC_remap((ptr_t)hbp, hhdr -> hb_sz);
+ GC_remap((ptr_t)hbp, (size_t)hhdr->hb_sz);
hhdr -> hb_flags &= ~WAS_UNMAPPED;
}
# endif
@@ -801,7 +801,7 @@ GC_allochblk_nth(size_t sz, int kind, unsigned flags, int n, int may_split)
if( size_avail >= size_needed ) {
# ifdef USE_MUNMAP
if (!IS_MAPPED(hhdr)) {
- GC_remap((ptr_t)hbp, hhdr -> hb_sz);
+ GC_remap((ptr_t)hbp, (size_t)hhdr->hb_sz);
hhdr -> hb_flags &= ~WAS_UNMAPPED;
/* Note: This may leave adjacent, mapped free blocks. */
}