Skip to content

Fix spurious none allocation #356

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexarchambault
Copy link
Contributor

Fixes #351

I didn't look into adding tests for this…

@alexarchambault alexarchambault force-pushed the fix-spurious-none-allocation branch from ea3c7be to 796c603 Compare August 17, 2023 13:45
@shadaj
Copy link
Member

shadaj commented Aug 19, 2023

Hmm, I don't think this is the source of the issue. The None value used here is allocated with safeGlobal = true (

private[scalapy] val noneValue: PyValue = PyValue.fromNew(CPythonAPI.Py_BuildValue(Platform.emptyCString), true)
), so warnings about globally-allocated values aren't printed for it. Also we can't be lazy here, because the value is global but would be deallocated if it's initialized in a local block.

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.

Warning: the value None was allocated into a global space
2 participants