Skip to content

Commit

Permalink
Fix 'GC_push_marked1 discards const qualifier' gcc error
Browse files Browse the repository at this point in the history
(fix of commit 1ab17de)

Issue #629 (bdwgc)

* mark.c [USE_PUSH_MARKED_ACCELERATORS] (GC_push_marked1): Specify hhdr
argument as const pointer.
* mark.c [USE_PUSH_MARKED_ACCELERATORS && !UNALIGNED_PTRS]
(GC_push_marked2): Likewise.
* mark.c [USE_PUSH_MARKED_ACCELERATORS && !UNALIGNED_PTRS
&& GC_GRANULE_WORDS<4] (GC_push_marked4): Likewise.
  • Loading branch information
ivmai committed Mar 29, 2024
1 parent 670c713 commit 4d6cdc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mark.c
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ GC_INNER void GC_push_all_stack(ptr_t bottom, ptr_t top)
/* Push all objects reachable from marked objects in the given block */
/* containing objects of size 1 granule. */
GC_ATTR_NO_SANITIZE_THREAD
STATIC void GC_push_marked1(struct hblk *h, hdr *hhdr)
STATIC void GC_push_marked1(struct hblk *h, const hdr *hhdr)
{
const word *mark_word_addr = &(hhdr -> hb_marks[0]);
word *p;
Expand Down Expand Up @@ -1795,7 +1795,7 @@ STATIC void GC_push_marked1(struct hblk *h, hdr *hhdr)
/* Push all objects reachable from marked objects in the given block */
/* of size 2 (granules) objects. */
GC_ATTR_NO_SANITIZE_THREAD
STATIC void GC_push_marked2(struct hblk *h, hdr *hhdr)
STATIC void GC_push_marked2(struct hblk *h, const hdr *hhdr)
{
const word *mark_word_addr = &(hhdr -> hb_marks[0]);
word *p;
Expand Down Expand Up @@ -1847,7 +1847,7 @@ STATIC void GC_push_marked2(struct hblk *h, hdr *hhdr)
/* There is a risk of mark stack overflow here. But we handle that. */
/* And only unmarked objects get pushed, so it's not very likely. */
GC_ATTR_NO_SANITIZE_THREAD
STATIC void GC_push_marked4(struct hblk *h, hdr *hhdr)
STATIC void GC_push_marked4(struct hblk *h, const hdr *hhdr)
{
const word *mark_word_addr = &(hhdr -> hb_marks[0]);
word *p;
Expand Down

0 comments on commit 4d6cdc0

Please sign in to comment.