-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce size of heap block per-granule maps twice for 4KB heap blocks
If MAXOBJGRANULES-1 fits into a byte, we could use unsigned char (instead of short) type for hb_map elements. * docs/tree.md (A picture): Specify that element of GC_obj_map is of either 8 or 16 bits (instead of 16 bits strictly); specify that hb_map field of hblkhdr could be of uchar* type. * include/private/gc_priv.h [!MARK_BIT_PER_OBJ] (hb_map_entry_t): New type (defined depending on values of CPP_LOG_HBLKSIZE and GC_GRANULE_BYTES); add comment. * include/private/gc_priv.h [!MARK_BIT_PER_OBJ] (hblkhdr.hb_map, _GC_arrays._obj_map[]): Change type from unsigned short* to hb_map_entry_t*. * obj_map.c [!MARK_BIT_PER_OBJ] (GC_add_map_entry): Change type of new_map local variable from unsigned short* to hb_map_entry_t*; update relevant casts and GC_scratch_alloc() argument accordingly; replace 0xffff to ~(hb_map_entry_t)0 in static assertion; expect GC_obj_map[lg] is already non-NULL on entrance.
- Loading branch information
Showing
3 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters