Skip to content

objc: create new blocks as stack blocks so Copy moves them - #518

Open
kumagi wants to merge 1 commit into
ebitengine:mainfrom
kumagi:fix/block-stack-isa
Open

objc: create new blocks as stack blocks so Copy moves them#518
kumagi wants to merge 1 commit into
ebitengine:mainfrom
kumagi:fix/block-stack-isa

Conversation

@kumagi

@kumagi kumagi commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What issue is this addressing?

Closes #523

What type of issue is this addressing?

bug

What this PR does | solves

NewBlock built its template with an NSMallocBlock isa, for which _Block_copy is a no-op retain of the Go-side allocation. The Block then points at Go memory invisible to the collector. Start from NSStackBlock so Copy relocates the block to the heap as the ABI requires.

NewBlock built its template with an __NSMallocBlock__ isa, for which
_Block_copy is a no-op retain of the Go-side allocation. The Block
then points at Go memory invisible to the collector. Start from
__NSStackBlock__ so Copy relocates the block to the heap as the ABI
requires.
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.

NewBlock uses __NSMallocBlock__ isa so Copy never moves the block off Go memory

1 participant