Skip to content

Commit f15fe4c

Browse files
committed
Provide method to set callback
1 parent 08ed283 commit f15fe4c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
package org.purejava.linux;
22

33
import java.lang.foreign.MemorySegment;
4+
import java.lang.foreign.MemorySession;
45

56
public class MemoryAllocator {
67
public static MemorySegment ALLOCATE_FOR(String str) {
78
return RuntimeHelper.CONSTANT_ALLOCATOR.allocateUtf8String(str);
89
}
10+
11+
public static MemorySegment ALLOCATE_CALLBACK_FOR(GCallback cb, MemorySession session) {
12+
return GCallback.allocate(cb, session);
13+
}
914
}

0 commit comments

Comments
 (0)