Skip to content

ffi: use a new C library namespace when the dynamic library load #57

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

Merged
merged 1 commit into from
Jun 1, 2020

Conversation

LeonidVas
Copy link
Collaborator

If symbols from the dynamic library are loaded into the
global namespace (ffi.C), by invoke ffi.load() with global
is true and without save the return value, it may be
garbage collected. For correct work the return value
must be saved.
Example - tarantool/tarantool#4999
So, use a new C library namespace instead the global one.
This will help to keep the global namespace clean and
avoid the problem with garbage collection.

@LeonidVas LeonidVas requested a review from Totktonada May 19, 2020 22:29
@LeonidVas LeonidVas self-assigned this May 19, 2020
If symbols from the dynamic library are loaded into the
global namespace (ffi.C), by invoke ffi.load() with global
is true and without save the return value, it may be
garbage collected. For correct work the return value
must be saved.
Example - tarantool/tarantool#4999
So, use a new C library namespace instead the global one.
This will help to keep the global namespace clean and
avoid the problem with garbage collection.
@LeonidVas LeonidVas force-pushed the lvasilev/gh-no-ticket-fix-so-load branch from 0fd9828 to aded02d Compare June 1, 2020 19:54
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

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

LGTM.

@Totktonada Totktonada merged commit 62a557f into master Jun 1, 2020
@Totktonada Totktonada deleted the lvasilev/gh-no-ticket-fix-so-load branch June 1, 2020 20:13
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