GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — fix(runtime): keep a JS function's block apart from its own wrapper by edusperoni · Pull Request #504 · NativeScript/ios Conversation
Collaborator
CauseA JS function marshalled as a block cached its
Fix
Tests
The existing "JS block outliving its worker" specs still test what they describe: a block outliving, or released by, its worker's teardown while the function is FunctionReference-registered. Teardown now disposes the function's Suite (iOS 26.3.1 simulator):
Fixes #503
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsA function wrapped in interop.FunctionReference and then marshalled as a block loses its FunctionReference state, so passing it as a C function pointer afterwards asserts. Marshalling it as a block after interop.FunctionReference also stops reusing the block it cached. Cover both orders, interop.handleof across them, a function pointer argument that is not a FunctionReference, collection of such functions, and a worker torn down while native code holds the block. A JS function marshalled as a block cached its BlockWrapper in the same slot that interop.FunctionReference keeps its wrapper in, so each use evicted the other: the FunctionReferenceWrapper leaked and a later function pointer marshal asserted, or the block cache stopped hitting. The block cache now lives in its own private slot on the function. The JSBlock still owns its BlockWrapper and only clears that slot while it still holds that wrapper, so ObjectManager never sees a JS block's wrapper. interop.handleof reports a FunctionReference's trampoline once it has one, and the live block otherwise. A second interop.FunctionReference on the same function keeps the existing wrapper and trampoline. A function pointer argument that is not a pointer, native function pointer or FunctionReference throws instead of asserting. Fixes #503
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. This branch has not been deployedNo deployments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. interop.FunctionReference function passed as a block, then as a function pointer, assertsUh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |