Skip to content
This repository was archived by the owner on Dec 29, 2024. It is now read-only.

Fix some regression issues#130

Merged
Trey2k merged 4 commits into
mainfrom
dev/memory
Jun 22, 2023
Merged

Fix some regression issues#130
Trey2k merged 4 commits into
mainfrom
dev/memory

Conversation

@Trey2k
Copy link
Copy Markdown
Member

@Trey2k Trey2k commented Jun 22, 2023

The previous set of changes caused some regression due to the differences of how GDExtension and Modules work. memove is needed for GDExtension because all Variants for it are pointers to Variants living in the engine, assigning to a null Variant allocated by lua will cause a null pointer deref. Therefore we skip the assignment operator by using memmove. We need to do some manually ref counting to make this work.

For modules memmove caused a lot more issues so this PR has the Module version use the assignment operator.

The other major change was we now test if a Callable is custom and send it as a blank LuaCallableExtra instead. We do this to create a wrapper to the callable custom which will always have a RefCounted. Without this we have no way to manually increment the ref counter so it gets cleaned up.

There was also some steps missing to fully expose the GC options which have been fixed.

@Trey2k
Copy link
Copy Markdown
Member Author

Trey2k commented Jun 22, 2023

LuaJIT module tests failed, but I can not replicate on my system. I mustve ran tests 20 or 30 times in a row without any crash like what happened on the runner. Ive also run about 10 iteration of tests using the same bin from the github actions build. And since it passed on a rerun I am going to be merging this. Leaving this comment as note though in case something pops up.

@Trey2k Trey2k merged commit 4b5d77b into main Jun 22, 2023
@Trey2k Trey2k deleted the dev/memory branch June 22, 2023 23:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant