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

Skip to content

Conversation

@tenderlove
Copy link

Setting class variables will mutate the shape of the receiver, causing more inline cache polymorphism than necessary. Storing functions in a hash would better serve the intended functionality, and also benefit runtime performance

Setting class variables will mutate the shape of the receiver, causing
more inline cache polymorphism than necessary.  Storing functions in a
hash would better serve the intended functionality, and also benefit
runtime performance
Copy link
Member

@larskanis larskanis left a comment

Choose a reason for hiding this comment

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

Hi Aaron! Tests fail with uninitialized constant LibTest::FFI_FUNCTIONS. Could you please fix this?

* Stash the Function in a module variable so it does not get garbage collected
* Stash the Function in a hash so it does not get garbage collected
*/
snprintf(var, sizeof(var), "@@%s", StringValueCStr(name));
Copy link
Member

Choose a reason for hiding this comment

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

The var variable can be removed.

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