Skip to content

Commit 8673648

Browse files
committed
reduce the scope of a few variables (from global to local); update a few comments in the GC code
1 parent 8efd1f0 commit 8673648

File tree

5 files changed

+402
-327
lines changed

5 files changed

+402
-327
lines changed

src/gc-common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ extern "C" {
2828
// GC Big objects
2929
// =========================================================================== //
3030

31+
// layout for big (>2k) objects
3132
JL_EXTENSION typedef struct _bigval_t {
3233
struct _bigval_t *next;
3334
struct _bigval_t *prev;

src/gc-debug.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,27 +1100,6 @@ void gc_count_pool(void)
11001100
jl_safe_printf("************************\n");
11011101
}
11021102

1103-
void _report_gc_finished(uint64_t pause, uint64_t freed, int full, int recollect, int64_t live_bytes) JL_NOTSAFEPOINT {
1104-
if (!gc_logging_enabled) {
1105-
return;
1106-
}
1107-
jl_safe_printf("\nGC: pause %.2fms. collected %fMB. %s %s\n",
1108-
pause/1e6, freed/(double)(1<<20),
1109-
full ? "full" : "incr",
1110-
recollect ? "recollect" : ""
1111-
);
1112-
1113-
jl_safe_printf("Heap stats: bytes_mapped %.2f MB, bytes_resident %.2f MB,\nheap_size %.2f MB, heap_target %.2f MB, Fragmentation %.3f\n",
1114-
jl_atomic_load_relaxed(&gc_heap_stats.bytes_mapped)/(double)(1<<20),
1115-
jl_atomic_load_relaxed(&gc_heap_stats.bytes_resident)/(double)(1<<20),
1116-
// live_bytes/(double)(1<<20), live byes tracking is not accurate.
1117-
jl_atomic_load_relaxed(&gc_heap_stats.heap_size)/(double)(1<<20),
1118-
jl_atomic_load_relaxed(&gc_heap_stats.heap_target)/(double)(1<<20),
1119-
(double)live_bytes/(double)jl_atomic_load_relaxed(&gc_heap_stats.heap_size)
1120-
);
1121-
// Should fragmentation use bytes_resident instead of heap_size?
1122-
}
1123-
11241103
#ifdef __cplusplus
11251104
}
11261105
#endif

src/gc-pages.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ NOINLINE jl_gc_pagemeta_t *jl_gc_alloc_page(void) JL_NOTSAFEPOINT
165165
}
166166

167167
// return a page to the freemap allocator
168-
void jl_gc_free_page(jl_gc_pagemeta_t *pg) JL_NOTSAFEPOINT
168+
NOINLINE void jl_gc_free_page(jl_gc_pagemeta_t *pg) JL_NOTSAFEPOINT
169169
{
170170
void *p = pg->data;
171171
gc_alloc_map_set((char*)p, GC_PAGE_FREED);

0 commit comments

Comments
 (0)