-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recompute array index shift for unsafe access in JCTools
Fixes segmentation faults when using mutiny.
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
extensions/mutiny/runtime/src/main/java/io/quarkus/mutiny/runtime/JCToolsSupport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.quarkus.mutiny.runtime; | ||
|
||
import com.oracle.svm.core.annotate.Alias; | ||
import com.oracle.svm.core.annotate.RecomputeFieldValue; | ||
import com.oracle.svm.core.annotate.TargetClass; | ||
|
||
class JCToolsSupport { | ||
} | ||
|
||
// Thanks to https://github.com/DataDog/dd-trace-java/pull/6020 | ||
@TargetClass(className = "org.jctools.util.UnsafeRefArrayAccess") | ||
final class Target_org_jctools_util_UnsafeRefArrayAccess { | ||
|
||
@Alias | ||
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.ArrayIndexShift, declClass = Object[].class) | ||
public static int REF_ELEMENT_SHIFT; | ||
} |