diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-08-03 07:53:47 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-08-03 21:26:18 +0300 |
commit | a7b3a08d30e0498de3ad44c5e75bc21600ef9ff8 (patch) | |
tree | 5b9b28d7894dfdc9875ddd9967db4fe06a4da6dc /os_dep.c | |
parent | 89308bed1754cafe54e713ef950ef04727c17299 (diff) | |
download | bdwgc-a7b3a08d30e0498de3ad44c5e75bc21600ef9ff8.tar.gz |
Use modHBLKSZ where possible
(refactoring)
* allchblk.c (GC_remove_from_fl_at, GC_add_to_fl, GC_get_first_part):
Replace v&(HBLKSIZE-1) to modHBLKSZ(v).
* allchblk.c [!GC_DISABLE_INCREMENTAL] (GC_allochblk_nth): Likewise.
* include/private/gc_priv.h (HBLKDISPL): Likewise.
* include/private/gc_hdrs.h (MAX_JUMP): Remove spaces in HBLKSIZE-1
(to match similar expressions).
* include/private/gc_priv.h (OBJ_SZ_TO_BLOCKS_CHECKED): Likewise.
* misc.c (block_add_size): Likewise.
* os_dep.c [!MSWIN_XBOX1 && !MSWINCE && (USE_WINALLOC || CYGWIN32)]
(GC_win32_get_mem): Likewise.
* include/private/gc_priv.h (HBLKMASK): Remove.
* include/private/gc_priv.h (obj_link): Remove extra space in the
expression.
* malloc.c (GC_generic_malloc_uncollectable): Replace
(word)op&(HBLKSIZE-1) to HBLKDISPL(op).
* mallocx.c (GC_realloc): Replace HBLKMASK to (HBLKSIZE-1).
Diffstat (limited to 'os_dep.c')
-rw-r--r-- | os_dep.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2454,8 +2454,8 @@ void * os2_alloc(size_t bytes) /* problems, so we dodge the issue. */ result = (ptr_t)GlobalAlloc(0, SIZET_SAT_ADD(bytes, HBLKSIZE)); /* Align it at HBLKSIZE boundary. */ - result = (ptr_t)(((word)result + HBLKSIZE - 1) - & ~(word)(HBLKSIZE - 1)); + result = (ptr_t)(((word)result + HBLKSIZE-1) + & ~(word)(HBLKSIZE-1)); } else # endif /* else */ { |