-
Bug
-
Resolution: Fixed
-
P3
-
None
-
repo-panama
Overload methods which do not take a ResourceScope (hence, they use an implicit scope instead) create some opportunities for bugs to hide; consider;
try (ResourceScope scope = ResourceScope.ofConfined()) {
MemorySegment str = CLinker.toCString("hello");
}
It is really hard for humans to see that the C string allocation does not use the outer scope (as the TWR block is visually very imposing, whereas implicit scope here is denoted by "absence").
try (ResourceScope scope = ResourceScope.ofConfined()) {
MemorySegment str = CLinker.toCString("hello");
}
It is really hard for humans to see that the C string allocation does not use the outer scope (as the TWR block is visually very imposing, whereas implicit scope here is denoted by "absence").