Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jhawthorn
Copy link
Member

@jhawthorn jhawthorn commented Dec 14, 2023

ruby_strdup is like strdup, but using xmalloc which informs Ruby's GC about the allocation (confusingly by including ruby/util.h strdup is defined into ruby_strdup, but let's use ruby_strdup for clarity). We need to use this because we use xfree for the message in parser_free.

The issue this causes is pretty minimal in regular builds, it will artificially decrease oldmalloc_increase_bytes, but it's unlikely to be a significant amount. However getting this correct is important so that this extension can be used with debug builds.

ruby_strdup is like strdup, but using xmalloc which informs Ruby's GC
about the allocation (confusingly by including ruby/util.h strdup is
defined into ruby_strdup, but let's use ruby_strdup for clarity).
@rafaelfranca rafaelfranca reopened this Mar 14, 2024
@rafaelfranca rafaelfranca merged commit 9fab8b1 into Shopify:main Mar 14, 2024
@jhawthorn jhawthorn deleted the ruby_strdup branch March 14, 2024 02:17
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