diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2018-02-23 00:19:37 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2018-02-23 00:19:37 +0300 |
commit | 0f831daec3acd2b934ba6ee31ff3406c90408134 (patch) | |
tree | c5edc1b6e495c55e02ad98fb7e4c911cc06a1c19 /headers.c | |
parent | 037991eba58acd89f8d368ca0e9fbdb3bc47d6a1 (diff) | |
download | bdwgc-0f831daec3acd2b934ba6ee31ff3406c90408134.tar.gz |
Omit register keyword in performance-critical code if C++ compiler used
Issue #206 (bdwgc).
* headers.c (GC_next_used_block): Replace register keyword to REGISTER.
* include/private/gc_hdrs.h [HASH_TL] (GET_BI, GET_HDR_ADDR, GET_HDR,
SET_HDR): Likewise.
* mark.c (GC_push_all_eager): Likewise.
* mark.c [WRAP_MARK_SOME && PARALLEL_MARK] (GC_push_conditional_eager):
Likewise.
* include/private/gc_priv.h (REGISTER): New macro (defined before
include gc_hdrs.h); add comment.
Diffstat (limited to 'headers.c')
-rw-r--r-- | headers.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -341,12 +341,13 @@ void GC_apply_to_all_blocks(void (*fn)(struct hblk *h, word client_data), /* Return 0 if there is none. */ GC_INNER struct hblk * GC_next_used_block(struct hblk *h) { - register bottom_index * bi; - register word j = ((word)h >> LOG_HBLKSIZE) & (BOTTOM_SZ-1); + REGISTER bottom_index * bi; + REGISTER word j = ((word)h >> LOG_HBLKSIZE) & (BOTTOM_SZ-1); GET_BI(h, bi); if (bi == GC_all_nils) { - register word hi = (word)h >> (LOG_BOTTOM_SZ + LOG_HBLKSIZE); + REGISTER word hi = (word)h >> (LOG_BOTTOM_SZ + LOG_HBLKSIZE); + bi = GC_all_bottom_indices; while (bi != 0 && bi -> key < hi) bi = bi -> asc_link; j = 0; |