Skip to content

Commit 671df98

Browse files
authored
Fix segfault when using jemalloc / tcmalloc (#26)
1 parent 2b0b74b commit 671df98

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

api/src/main/java/club/minnced/discord/jdave/ffi/LibDave.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private LibDave() {}
2828
static final Logger log = LoggerFactory.getLogger(LibDave.class);
2929
static final MethodHandle daveMaxSupportedProtocolVersion;
3030
static final MethodHandle daveSetLogSinkCallback;
31-
static final MethodHandle free;
31+
static final MethodHandle daveFree;
3232

3333
static {
3434
try {
@@ -41,9 +41,9 @@ private LibDave() {}
4141
daveSetLogSinkCallback = LINKER.downcallHandle(
4242
SYMBOL_LOOKUP.find("daveSetLogSinkCallback").orElseThrow(), FunctionDescriptor.ofVoid(ADDRESS));
4343

44-
// void free(void*);
45-
free = LINKER.downcallHandle(
46-
LINKER.defaultLookup().find("free").orElseThrow(), FunctionDescriptor.ofVoid(ADDRESS));
44+
// void daveFree(void*);
45+
daveFree = LINKER.downcallHandle(
46+
SYMBOL_LOOKUP.find("daveFree").orElseThrow(), FunctionDescriptor.ofVoid(ADDRESS));
4747
} catch (Throwable e) {
4848
throw new ExceptionInInitializerError(e);
4949
}
@@ -53,7 +53,7 @@ private LibDave() {}
5353

5454
public static void free(@NonNull MemorySegment segment) {
5555
try {
56-
free.invoke(segment);
56+
daveFree.invoke(segment);
5757
} catch (Throwable e) {
5858
throw new LibDaveBindingException(e);
5959
}

native/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fun getArtifactName(): String {
3636
}
3737

3838
fun getArtifactDownloadUrl(): String {
39-
return "https://github.com/MinnDevelopment/libdave/releases/download/v1.1.0/${getArtifactName()}"
39+
return "https://github.com/MinnDevelopment/libdave/releases/download/v1.1.1/${getArtifactName()}"
4040
}
4141

4242
val nativeResourceRoot = "resources/libdave"

0 commit comments

Comments
 (0)