summaryrefslogtreecommitdiff
path: root/mark.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2021-09-11 22:38:58 +0300
committerIvan Maidanski <ivmai@mail.ru>2021-09-11 22:47:10 +0300
commitb0a8c99c0370f90a034c41e8c7b7bc2344a35e03 (patch)
tree3c68233e0ceb90331eac601d69ed42f3bd5df1cd /mark.c
parentdeea7da6268185b12238399530a561938189d336 (diff)
downloadbdwgc-b0a8c99c0370f90a034c41e8c7b7bc2344a35e03.tar.gz
Move GC_scratch_recycle_inner() to alloc.c (refactoring)
* alloc.c (GC_try_to_collect): Add blank line after comment (which relates not only to this function). * alloc.c (GC_add_to_heap): Declare as STATIC function; change definition from GC_INNER to STATIC; reformat comments. * alloc.c (GC_scratch_recycle_inner): Move function from mark.c. * include/private/gc_priv.h (GC_add_to_heap): Remove declaration.
Diffstat (limited to 'mark.c')
-rw-r--r--mark.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/mark.c b/mark.c
index 045ce559..925b057b 100644
--- a/mark.c
+++ b/mark.c
@@ -1239,26 +1239,6 @@ GC_INNER void GC_help_marker(word my_mark_no)
#endif /* PARALLEL_MARK */
-GC_INNER void GC_scratch_recycle_inner(void *ptr, size_t bytes)
-{
- if (ptr != NULL) {
- size_t page_offset = (word)ptr & (GC_page_size - 1);
- size_t displ = 0;
- size_t recycled_bytes;
-
- GC_ASSERT(bytes != 0);
- GC_ASSERT(GC_page_size != 0);
- /* TODO: Assert correct memory flags if GWW_VDB */
- if (page_offset != 0)
- displ = GC_page_size - page_offset;
- recycled_bytes = (bytes - displ) & ~(GC_page_size - 1);
- GC_COND_LOG_PRINTF("Recycle %lu scratch-allocated bytes at %p\n",
- (unsigned long)recycled_bytes, ptr);
- if (recycled_bytes > 0)
- GC_add_to_heap((struct hblk *)((word)ptr + displ), recycled_bytes);
- }
-}
-
/* Allocate or reallocate space for mark stack of size n entries. */
/* May silently fail. */
static void alloc_mark_stack(size_t n)