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

Fix compaction on nodes #2579

Merged
merged 6 commits into from
Jul 12, 2022
Merged

Fix compaction on nodes #2579

merged 6 commits into from
Jul 12, 2022

Commits on Jul 10, 2022

  1. Always set a mark function on the node wrapper

    Unconditionally set a mark function on the node wrapper.  We will later
    refactor this to use TypedData_Wrap_Struct and we don't want to
    conditionally set mark functions on that
    
    Co-Authored-By: Mike Dalessio <mike.dalessio@gmail.com>
    tenderlove and flavorjones committed Jul 10, 2022
    Configuration menu
    Copy the full SHA
    b370fbd View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2022

  1. Add a "node unwrap" macro and use it

    This commit introduces a `Noko_Node_Get_Struct` macro for unwrapping
    the underlying data pointer from Nokogiri objects. Then we change all
    places that unwrap nodes to use the new macro. We also converted
    xmlNode to use `TypedData_Wrap_Struct` so we can provide a compaction
    function.
    
    Note that we use DATA_PTR instead of "typed" unwrappers everywhere
    because the large number of C structs that inherit from xmlNode would
    make the unwrapping code unwieldy and type-check-heavy.
    
    Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
    Co-Authored-By: Mike Dalessio <mike.dalessio@gmail.com>
    3 people committed Jul 11, 2022
    Configuration menu
    Copy the full SHA
    9411ff7 View commit details
    Browse the repository at this point in the history
  2. Add compaction callback to nodes

    This fixes the case where nodes moves and we need to update the private
    references.
    
    Co-Authored-By: Matt Valentine-House <matt@eightbitraptor.com>
    Co-Authored-By: Mike Dalessio <mike.dalessio@gmail.com>
    3 people committed Jul 11, 2022
    Configuration menu
    Copy the full SHA
    513207f View commit details
    Browse the repository at this point in the history
  3. Only check compaction on platforms that support it

    Co-Authored-By: Mike Dalessio <mike.dalessio@gmail.com>
    tenderlove and flavorjones committed Jul 11, 2022
    Configuration menu
    Copy the full SHA
    b9f9175 View commit details
    Browse the repository at this point in the history
  4. Only add compaction callback on Rubies that support it

    We don't have `rb_gc_location` everywhere, so check for it in the
    extconf and then conditionally set the compaction callback
    
    Co-Authored-By: Mike Dalessio <mike.dalessio@gmail.com>
    tenderlove and flavorjones committed Jul 11, 2022
    Configuration menu
    Copy the full SHA
    535bb50 View commit details
    Browse the repository at this point in the history
  5. test: add memcheck suppressions

    for warnings triggered by the compaction test.
    
    - for memory allocated in ary_heap_realloc
    - for memory added to the mark stack in stack_chunk_alloc
    flavorjones committed Jul 11, 2022
    Configuration menu
    Copy the full SHA
    a036080 View commit details
    Browse the repository at this point in the history