Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional fields to GC:ProfStats #13734

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/gc.cr
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ module GC
gc_no : UInt64,
markers_m1 : UInt64,
bytes_reclaimed_since_gc : UInt64,
reclaimed_bytes_before_gc : UInt64
reclaimed_bytes_before_gc : UInt64,
expl_freed_bytes_since_gc : UInt64,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is is the same naming as Boehm but should this be more clear

maybe something like explicitly_freed_bytes_since_gc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going with the library names everywhere else, so it's fine to keep that here as well.

obtained_from_os_bytes : UInt64

# Allocates and clears *size* bytes of memory.
#
Expand Down
6 changes: 5 additions & 1 deletion src/gc/boehm.cr
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ lib LibGC
markers_m1 : Word
bytes_reclaimed_since_gc : Word
reclaimed_bytes_before_gc : Word
expl_freed_bytes_since_gc : Word
obtained_from_os_bytes : Word
end

fun init = GC_init
Expand Down Expand Up @@ -241,7 +243,9 @@ module GC
gc_no: stats.gc_no.to_u64!,
markers_m1: stats.markers_m1.to_u64!,
bytes_reclaimed_since_gc: stats.bytes_reclaimed_since_gc.to_u64!,
reclaimed_bytes_before_gc: stats.reclaimed_bytes_before_gc.to_u64!)
reclaimed_bytes_before_gc: stats.reclaimed_bytes_before_gc.to_u64!,
expl_freed_bytes_since_gc: stats.expl_freed_bytes_since_gc.to_u64!,
obtained_from_os_bytes: stats.obtained_from_os_bytes.to_u64!)
end

{% if flag?(:win32) %}
Expand Down
4 changes: 3 additions & 1 deletion src/gc/none.cr
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ module GC
gc_no: 0,
markers_m1: 0,
bytes_reclaimed_since_gc: 0,
reclaimed_bytes_before_gc: 0)
reclaimed_bytes_before_gc: 0,
expl_freed_bytes_since_gc: 0,
obtained_from_os_bytes: 0)
end

{% if flag?(:win32) %}
Expand Down