Skip to content

Allocate Graph memory from Ruby GC#850

Draft
amomchilov wants to merge 2 commits into
mainfrom
Alex/Ruby-owned-graph-alloc
Draft

Allocate Graph memory from Ruby GC#850
amomchilov wants to merge 2 commits into
mainfrom
Alex/Ruby-owned-graph-alloc

Conversation

@amomchilov

Copy link
Copy Markdown
Contributor

Previously, the Graph objects were initialized in a new Rust-allocated Box.

Let's switch to allocating this memory from the Ruby GC. This has several benefits:

  1. Like xmalloc(), it gives the GC a chance to run if there isn't much free memory available
  2. It puts us on the path to using RUBY_TYPED_EMBEDDABLE for more optimal allocations

amomchilov commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@amomchilov amomchilov changed the base branch from main to graphite-base/850 June 9, 2026 20:04
@amomchilov amomchilov force-pushed the Alex/Ruby-owned-graph-alloc branch from 20daf72 to e0522af Compare June 9, 2026 20:04
@amomchilov amomchilov changed the base branch from graphite-base/850 to Alex/designated-initializers June 9, 2026 20:04
@amomchilov amomchilov force-pushed the Alex/Ruby-owned-graph-alloc branch from e0522af to c2e7f21 Compare June 9, 2026 20:11
@amomchilov amomchilov marked this pull request as ready for review June 9, 2026 20:44
@amomchilov amomchilov requested a review from a team as a code owner June 9, 2026 20:44
@amomchilov amomchilov changed the base branch from Alex/designated-initializers to graphite-base/850 June 10, 2026 20:00
@amomchilov amomchilov force-pushed the Alex/Ruby-owned-graph-alloc branch from c2e7f21 to efeb7e0 Compare June 10, 2026 20:01
@graphite-app graphite-app Bot changed the base branch from graphite-base/850 to main June 10, 2026 20:01
@amomchilov amomchilov force-pushed the Alex/Ruby-owned-graph-alloc branch from efeb7e0 to 69e5332 Compare June 10, 2026 20:01
Previously, the Graph objects were initialized in a new Rust-allocated Box.

Let's switch to allocating this memory from the Ruby GC. This has several benefits:
1. Like `xmalloc()`, it gives the GC a chance to run if there isn't much free memory available
2. It puts us on the path to using `RUBY_TYPED_EMBEDDABLE` for more optimal allocations
@amomchilov amomchilov force-pushed the Alex/Ruby-owned-graph-alloc branch from 69e5332 to c9fd983 Compare June 11, 2026 18:31
@amomchilov amomchilov marked this pull request as draft June 11, 2026 19:23
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