Skip to content

Move C heap allocations into GC heap for RVALUE object data#4107

Closed
eightbitraptor wants to merge 5 commits into
ruby:masterfrom
Shopify:mvh-pz-vwa-mvp
Closed

Move C heap allocations into GC heap for RVALUE object data#4107
eightbitraptor wants to merge 5 commits into
ruby:masterfrom
Shopify:mvh-pz-vwa-mvp

Conversation

@eightbitraptor

Copy link
Copy Markdown
Member

Redmine ticket

RVALUE is fixed width (40 bytes), some of which is used for accounting information and the remainder being used for storage of the object data (e.g. string contents). If the data required is larger than the available space inside the RVALUE, memory is allocated outside of the GC heap using malloc and a pointer to the malloc’d region is stored inside the RVALUE instead.

We intend to remove this extra memory allocation in favour of storing the extra data in a contiguous region of slots in the heap that are adjacent to the original RVALUE.

This branch is the minimum viable implementation required to test our hypothesis. We introduce an API to allocate regions that are multiple slots wide in the heap and we implement this API for objects of type T_CLASS so that the rb_classext_t struct is stored in the heap alongside its owning RVALUE.

cc @peterzhu2118

@peterzhu2118
peterzhu2118 force-pushed the mvh-pz-vwa-mvp branch 7 times, most recently from 7c094cf to 5e4c7d2 Compare February 2, 2021 15:11
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.

1 participant