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

Introducing new arena and function that allows an object to be ignored by GC #1141

Closed
wants to merge 10 commits into from

Conversation

Robertorosmaninho
Copy link
Collaborator

@Robertorosmaninho Robertorosmaninho commented Sep 3, 2024

This PR introduces a new Arena and a function to bypass the Garbage Collector, as it may have some times when we don't want to waste time deallocating memory that would be reallocated later for the same data.

The freeze hook function returns the same block with a different allocation in a new Arena.

@Robertorosmaninho Robertorosmaninho self-assigned this Sep 3, 2024
@rv-jenkins rv-jenkins changed the base branch from master to develop September 3, 2024 13:08
@Robertorosmaninho
Copy link
Collaborator Author

A c++ unittest is under development, but this was already tested using a K definition for a future K PR.

@Robertorosmaninho Robertorosmaninho marked this pull request as ready for review September 3, 2024 15:56
Copy link
Collaborator

@dwightguth dwightguth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a work in progress, obviously, but I added some comments about how you need to adjust this in order to complete it. For more information about how to copy the internal structure of the data types that are handled specially, take a look at runtime/collect/collect.cpp, which has migrate_map, migrate_mpz, etc functions which do a bit different of things than you want to do but do, among other things, copy the entire internal structure of the term to a new arena.

runtime/meta/kreflection.cpp Show resolved Hide resolved
runtime/meta/kreflection.cpp Outdated Show resolved Hide resolved
runtime/meta/kreflection.cpp Outdated Show resolved Hide resolved
runtime/meta/kreflection.cpp Outdated Show resolved Hide resolved
Introducing new function allocation `kore_alloc_forever`
Introducing `hook_KREFLECTION_freeze` function
@Robertorosmaninho
Copy link
Collaborator Author

Closing as the performance gain isn't meaningful.

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