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

Arena Allocator #3231

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Arena Allocator #3231

wants to merge 10 commits into from

Conversation

Cluster444
Copy link

Rebased from #2913 into main

@tenderlove tenderlove self-requested a review December 2, 2024 18:40
Copy link
Member

@tenderlove tenderlove left a comment

Choose a reason for hiding this comment

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

I think this looks good. The arena implementation seems fine, I left a few minor commit suggestions but I don't see any actual problems.

@jhawthorn do you mind taking a look at this (if you have time)? Otherwise I'm going to merge it.

@@ -164,6 +164,7 @@
* #endif
* ```
*/

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@@ -21505,6 +21441,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t
}
case PM_TOKEN_QUESTION_MARK: {
context_push(parser, PM_CONTEXT_TERNARY);

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

@@ -22161,6 +22098,10 @@ pm_parser_init(pm_parser_t *parser, const uint8_t *source, size_t size, const pm
.warn_mismatched_indentation = true
};

// TODO: find a better starting size
Copy link
Member

Choose a reason for hiding this comment

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

👍

4k is probably a fine starting size, maybe we can add some logging later and figure out a better start.

@@ -100,7 +100,7 @@ pm_node_stack_pop(pm_node_stack_node_t **stack) {
const pm_node_t *visit = current->visit;

*stack = current->prev;
xfree(current);
// xfree(current);
Copy link
Member

Choose a reason for hiding this comment

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

Should we just delete this?

@kddnewton
Copy link
Collaborator

@tenderlove make sure you don't merge this before we get this working in ruby/ruby using the new API, otherwise this is going to break a bunch of stuff. I've been holding off on merging this because I want to make sure we can do some benchmarking on both speed and memory from within CRuby before we go this route, since it's a such an invasive change.

@kddnewton kddnewton mentioned this pull request Jan 23, 2025
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.

4 participants