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

Skip to content

Fix spurious none allocation#356

Open
alexarchambault wants to merge 1 commit into
scalapy:mainfrom
alexarchambault:fix-spurious-none-allocation
Open

Fix spurious none allocation#356
alexarchambault wants to merge 1 commit into
scalapy:mainfrom
alexarchambault:fix-spurious-none-allocation

Conversation

@alexarchambault

Copy link
Copy Markdown
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

shadaj commented Aug 19, 2023

Copy link
Copy Markdown
Member

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