-
Notifications
You must be signed in to change notification settings - Fork 151
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
base: main
Are you sure you want to change the base?
Arena Allocator #3231
Conversation
There was a problem hiding this 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 | |||
* ``` | |||
*/ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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 |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
@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. |
Rebased from #2913 into main