-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add new
@CriticalRegion
annotation to allow zero-copy access to …
…data of Java arrays (pull #254)
- Loading branch information
1 parent
fa35503
commit c50d69f
Showing
4 changed files
with
41 additions
and
3 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
18 changes: 18 additions & 0 deletions
18
src/main/java/org/bytedeco/javacpp/annotation/CriticalRegion.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,18 @@ | ||
package org.bytedeco.javacpp.annotation; | ||
|
||
import org.bytedeco.javacpp.tools.Generator; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* In some methods, {@link Generator} will generate code to transfer arrays from the | ||
* JVM to native code using the {@code Get/Release<primitivetype>ArrayElements} methods. | ||
* However these methods copy the underlying data. With this annotation, the generated | ||
* code will always call the {@code Get/ReleasePrimitiveArrayCritical} methods instead. | ||
* | ||
* @see Generator | ||
* | ||
*/ | ||
@Documented @Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.TYPE, ElementType.METHOD}) | ||
public @interface CriticalRegion { } |
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
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