summaryrefslogtreecommitdiff
path: root/obj_map.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-03-05 08:08:27 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-03-05 08:10:56 +0300
commitddbc329fc63bc9369026c06593b55dd8d76ef017 (patch)
tree529a8b7d1a87465c11fc59de1ce997bbe3196421 /obj_map.c
parentdbf1d2e9b106902333712e49be4e6e21edb8a421 (diff)
downloadbdwgc-ddbc329fc63bc9369026c06593b55dd8d76ef017.tar.gz
Rename MAP_LEN internal macro to OBJ_MAP_LEN
(refactoring) * doc/tree.md (A picture): Rename MAP_LEN to OBJ_MAP_LEN. * obj_map.c [MARK_BIT_PER_GRANULE] (GC_add_map_entry): Likewise. * include/private/gc_priv.h (hblkhdr.hb_marks): Reformat comment (to have quoted phrase on a line). * include/private/gc_priv.h [MARK_BIT_PER_GRANULE] (MAP_LEN): Rename to OBJ_MAP_LEN. * obj_map.c [MARK_BIT_PER_GRANULE] (GC_add_map_entry): Replace BYTES_TO_GRANULES(HBLKSIZE) to OBJ_MAP_LEN.
Diffstat (limited to 'obj_map.c')
-rw-r--r--obj_map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/obj_map.c b/obj_map.c
index 8c7c1d57..bd46f53d 100644
--- a/obj_map.c
+++ b/obj_map.c
@@ -59,18 +59,18 @@ GC_INNER void GC_register_displacement_inner(size_t offset)
return(TRUE);
}
- new_map = (unsigned short *)GC_scratch_alloc(MAP_LEN * sizeof(short));
+ new_map = (unsigned short *)GC_scratch_alloc(OBJ_MAP_LEN * sizeof(short));
if (EXPECT(NULL == new_map, FALSE)) return FALSE;
GC_COND_LOG_PRINTF(
"Adding block map for size of %u granules (%u bytes)\n",
(unsigned)granules, (unsigned)GRANULES_TO_BYTES(granules));
if (granules == 0) {
- for (displ = 0; displ < BYTES_TO_GRANULES(HBLKSIZE); displ++) {
+ for (displ = 0; displ < OBJ_MAP_LEN; displ++) {
new_map[displ] = 1; /* Nonzero to get us out of marker fast path. */
}
} else {
- for (displ = 0; displ < BYTES_TO_GRANULES(HBLKSIZE); displ++) {
+ for (displ = 0; displ < OBJ_MAP_LEN; displ++) {
new_map[displ] = (unsigned short)(displ % granules);
}
}