diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2021-09-11 22:38:58 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2021-09-11 22:47:10 +0300 |
commit | b0a8c99c0370f90a034c41e8c7b7bc2344a35e03 (patch) | |
tree | 3c68233e0ceb90331eac601d69ed42f3bd5df1cd /mark.c | |
parent | deea7da6268185b12238399530a561938189d336 (diff) | |
download | bdwgc-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.c | 20 |
1 files changed, 0 insertions, 20 deletions
@@ -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) |