11package fr .hammons .slinc
22
3- import jdk .incubator .foreign .CLinker
43import jdk .incubator .foreign .ResourceScope
54import jdk .incubator .foreign .SegmentAllocator
65import jdk .incubator .foreign .MemoryAddress
76
8- class Scope17 ( linker : CLinker ) extends ScopeI .PlatformSpecific :
7+ object Scope17 extends ScopeI .PlatformSpecific :
98 private val baseNull = Ptr [Nothing ](
109 Mem17 (MemoryAddress .NULL .nn.asSegment(1 , ResourceScope .globalScope).nn),
1110 Bytes (0 )
@@ -17,14 +16,14 @@ class Scope17(linker: CLinker) extends ScopeI.PlatformSpecific:
1716 def apply [A ](fn : (Allocator ) ?=> A ): A =
1817 val rs = ResourceScope .globalScope().nn
1918 given Allocator =
20- Allocator17 (SegmentAllocator .arenaAllocator(rs).nn, rs, linker)
19+ Allocator17 (SegmentAllocator .arenaAllocator(rs).nn, rs, Slinc17 . linker)
2120 fn
2221
2322 def createConfinedScope : ConfinedScope = new ConfinedScope :
2423 def apply [A ](fn : Allocator ?=> A ): A =
2524 val rs = ResourceScope .newConfinedScope().nn
2625 given Allocator =
27- Allocator17 (SegmentAllocator .arenaAllocator(rs).nn, rs, linker)
26+ Allocator17 (SegmentAllocator .arenaAllocator(rs).nn, rs, Slinc17 . linker)
2827 val res = fn
2928 rs.close()
3029 res
@@ -33,7 +32,7 @@ class Scope17(linker: CLinker) extends ScopeI.PlatformSpecific:
3332 def apply [A ](fn : Allocator ?=> A ): A =
3433 val rs = ResourceScope .newSharedScope().nn
3534 given Allocator =
36- Allocator17 (SegmentAllocator .arenaAllocator(rs).nn, rs, linker)
35+ Allocator17 (SegmentAllocator .arenaAllocator(rs).nn, rs, Slinc17 . linker)
3736 val res = fn
3837 rs.close()
3938 res
@@ -46,7 +45,7 @@ class Scope17(linker: CLinker) extends ScopeI.PlatformSpecific:
4645 given Allocator = Allocator17 (
4746 segmentAllocator,
4847 ResourceScope .globalScope().nn,
49- linker
48+ Slinc17 . linker
5049 )
5150 val res = fn
5251 allocator.reset()
@@ -55,5 +54,5 @@ class Scope17(linker: CLinker) extends ScopeI.PlatformSpecific:
5554 def createInferredScope : InferredScope = new InferredScope :
5655 def apply [A ](fn : Allocator ?=> A ): A =
5756 val scope = ResourceScope .newSharedScope().nn
58- given Allocator = InferredAllocator17 (scope, linker)
57+ given Allocator = InferredAllocator17 (scope, Slinc17 . linker)
5958 fn
0 commit comments