Skip to content

Conversation

@aitap
Copy link
Member

@aitap aitap commented Dec 21, 2025

Description

When creating data.table lists or their names, set the GROWABLE_BIT on them. This ensures that R_resizeVector used by data.table won't refuse to work with such data.tables. Drop the finalizer as gc() will count the memory taken by growable vectors correctly.

Main Changes

  • call SET_GROWABLE_BIT when setting TRUELENGTH in shallow() and setnames()
  • the finalizer is no longer needed

Checklist

  • I have performed a self-review of my code.
    • R CMD check passes (except for cryptic vignette problems) with data.table from CRAN and from current master.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have updated the documentation where applicable.

Additional Context

Please let me know how you would like to deal with SET_GROWABLE_BIT not being an API entry point. It could be hidden as are other non-API entry points, or the code could make use of R_allocResizableVector and backport it for R < 4.6.

When planning to resize vectors, set the GROWABLE_BIT on them. Drop the
finalizer as gc() will count the memory taken by growable vectors
correctly.
@SebKrantz
Copy link
Member

Many thanks @aitap!

@SebKrantz SebKrantz merged commit ba0b429 into fastverse:master Dec 22, 2025
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants