detached 656af01

objc: use the stack class for new block templates (#518)

Initialize block templates with __NSStackBlock__ to match their
state before copying. Block_copy selects its behavior from the flags
and assigns __NSMallocBlock__ to the heap copy, so this corrects the
class without changing the copy behavior.

Closes #523
commit
656af01456b2cd7a761884de06ccd88b31c30032
author
Hiroki KUMAZAKI · · 2026-09-20 17:33 UTC
committer
GitHub · · 2026-09-20 17:33 UTC
parent
19b4768
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
1 file · +4 -1
M objc/objc_block_darwin.go +4 -1
@@ -19,7 +19,10 @@ const (
1919 // when the reference count drops to zero, so the associated function is also unreferenced.
2020
2121 // blockBaseClass is the name of the class that block objects will be initialized with.
22- blockBaseClass = "__NSMallocBlock__"
22+ // A new block is a template that Block_copy always relocates to the
23+ // Objective-C heap, so the stack-block class is the accurate name here,
24+ // as the isa of the copied block becomes __NSMallocBlock__ anyway.
25+ blockBaseClass = "__NSStackBlock__"
2326 // blockFlags is the set of flags that block objects will be initialized with.
2427 blockFlags = blockHasCopyDispose | blockHasSignature
2528
@@ -19,7 +19,10 @@ const (
19 // when the reference count drops to zero, so the associated function is also unreferenced.19 // when the reference count drops to zero, so the associated function is also unreferenced.
20 20
21 // blockBaseClass is the name of the class that block objects will be initialized with.21 // blockBaseClass is the name of the class that block objects will be initialized with.
22- blockBaseClass = "__NSMallocBlock__"22+ // A new block is a template that Block_copy always relocates to the
23+ // Objective-C heap, so the stack-block class is the accurate name here,
24+ // as the isa of the copied block becomes __NSMallocBlock__ anyway.
25+ blockBaseClass = "__NSStackBlock__"
23 // blockFlags is the set of flags that block objects will be initialized with.26 // blockFlags is the set of flags that block objects will be initialized with.
24 blockFlags = blockHasCopyDispose | blockHasSignature27 blockFlags = blockHasCopyDispose | blockHasSignature
25 28

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close