Skip to content

Implement the last missing Write Barriers and dsize#1011

Merged
larskanis merged 1 commit into
ffi:masterfrom
casperisfine:array-type-write-barrier
Mar 6, 2023
Merged

Implement the last missing Write Barriers and dsize#1011
larskanis merged 1 commit into
ffi:masterfrom
casperisfine:array-type-write-barrier

Conversation

@casperisfine

Copy link
Copy Markdown

Ref: #991

Write barrier protected objects are allowed to be promoted to the old generation, which means they only get marked on major GC.

The downside is that the RB_BJ_WRITE macro MUST be used to set references, otherwise the referenced object may be garbaged collected.

This commit also implement a dsize function so that these instance report a more relevant size in various memory profilers. It's not counting everything because some types are opaque right now, so a larger refactoring would be needed.

Ref: ffi#991

Write barrier protected objects are allowed to be promoted to the old generation,
which means they only get marked on major GC.

The downside is that the RB_BJ_WRITE macro MUST be used to set references,
otherwise the referenced object may be garbaged collected.

This commit also implement a `dsize` function so that these instance report
a more relevant size in various memory profilers. It's not counting everything
because some types are opaque right now, so a larger refactoring would be needed.
@casperisfine

Copy link
Copy Markdown
Author

This is the last one, thank you so much @larskanis for the prompt reviews and merge ❤️

@larskanis
larskanis merged commit c5cd42e into ffi:master Mar 6, 2023
@casperisfine

Copy link
Copy Markdown
Author

FWIW: I tested the master branch against our app, seems to work fine. We're not huge FFI users though, it's mostly via dependencies like sass-c, etc.

@casperisfine casperisfine mentioned this pull request Apr 3, 2023
40 tasks
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.

3 participants