Skip to content

Commit

Permalink
Eliminate 'unused function GC_unprotect_all_heap' warning on Linux
Browse files Browse the repository at this point in the history
(fix of commit 804fd77)

Issue #579 (bdwgc).

* os_dep.c [MPROTECT_VDB && CAN_HANDLE_FORK
&& !COUNT_PROTECTED_REGIONS] (GC_unprotect_all_heap): Do not define
unless DARWIN.
  • Loading branch information
ivmai committed Feb 12, 2024
1 parent 0efb130 commit f33bd15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions os_dep.c
Original file line number Diff line number Diff line change
Expand Up @@ -3567,7 +3567,8 @@ STATIC void GC_protect_heap(void)
/* problems. It is preferred that the client instead avoids writing */
/* to the write-protected heap with a system call. */

# if defined(CAN_HANDLE_FORK) || defined(COUNT_PROTECTED_REGIONS)
# if defined(CAN_HANDLE_FORK) && defined(DARWIN) \
|| defined(COUNT_PROTECTED_REGIONS)
/* Remove protection for the entire heap not updating GC_dirty_pages. */
STATIC void GC_unprotect_all_heap(void)
{
Expand All @@ -3579,7 +3580,7 @@ STATIC void GC_protect_heap(void)
UNPROTECT(GC_heap_sects[i].hs_start, GC_heap_sects[i].hs_bytes);
}
}
# endif /* CAN_HANDLE_FORK || COUNT_PROTECTED_REGIONS */
# endif /* CAN_HANDLE_FORK && DARWIN || COUNT_PROTECTED_REGIONS */

# ifdef COUNT_PROTECTED_REGIONS
GC_INNER void GC_handle_protected_regions_limit(void)
Expand Down

0 comments on commit f33bd15

Please sign in to comment.