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

Updated GC signatures #1530

Merged
merged 1 commit into from
Mar 18, 2024
Merged

Conversation

sampersand
Copy link
Contributor

@sampersand sampersand commented Sep 20, 2023

This pr updates GC's signatures, unit tests, and adds in the Writer test type (which implements _Writer).

Two methods, GC.latest_gc_info and GC.stat technically can accept any hash, and just add their respective keys/values (e.g. [K,V] (Hash[K, V]) -> Hash[K | Symbol, V | Integer]). However, this is currently not testable, and the added complication of supporting it isn't worth the very niche—but technically correct—signature.

In addition to removing the occasional leading ::, this has the following changes:

  • GC::compact_info type alias was added for the return value of GC.compact and other methods
  • GC::{INTERNAL_CONSTANTS,OPTS}: Moved inside the class
  • GC.start: Removed duplicate argument names.
  • GC.stat: Gave actual names to arguments, Hash variant is now nilable.
  • GC.stress: bool not TrueClass | FalseClass
  • GC.stress=: Split Integer and bool cases apart to fix return value.
  • GC.verify_compaction_references: Added optional toward, double_heap and expand_heap keyword arguments
  • GC.latest_gc_info: nil is now accepted, removed K from the Hash[K | Symbol, unty]ed function.
  • GC.garbage_collect: Removed duplicate argument names.
  • GC::Profiler was moved inside the class, and auto_compact-related functions were added.

@sampersand sampersand force-pushed the swesterman/23-09-06/gc branch 2 times, most recently from a120da7 to 6171416 Compare September 21, 2023 03:10
@sampersand sampersand marked this pull request as ready for review September 21, 2023 03:11
@sampersand sampersand force-pushed the swesterman/23-09-06/gc branch from 6171416 to c63a5e1 Compare September 21, 2023 03:13
@sampersand
Copy link
Contributor Author

@soutaro soutaro self-requested a review December 5, 2023 00:33
@soutaro soutaro added this to the RBS 3.4 milestone Dec 5, 2023
@soutaro soutaro force-pushed the swesterman/23-09-06/gc branch from dea3f9a to dfaec42 Compare December 5, 2023 01:24
@soutaro soutaro modified the milestones: RBS 3.4, RBS 3.5 Dec 14, 2023
@sampersand sampersand force-pushed the swesterman/23-09-06/gc branch from 05c9850 to d756270 Compare December 26, 2023 23:38
@sampersand sampersand force-pushed the swesterman/23-09-06/gc branch 5 times, most recently from d1f07ba to 90becea Compare February 8, 2024 03:36
Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

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

👍

@soutaro soutaro force-pushed the swesterman/23-09-06/gc branch from 90becea to e1b95e8 Compare March 18, 2024 05:21
@soutaro soutaro enabled auto-merge March 18, 2024 05:21
@soutaro soutaro added this pull request to the merge queue Mar 18, 2024
Merged via the queue into ruby:master with commit 726ced6 Mar 18, 2024
17 checks passed
@soutaro soutaro added the Released PRs already included in the released version label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

2 participants