@Retention(value=RUNTIME) @Target(value={PARAMETER,ANNOTATION_TYPE}) public @interface Clear
@Out
paramneter
should be cleared before passing to the native function.
By default, parameters that are annotated as @Out
only do not clear
the data in the temporary native memory area allocated when a java heap object
is passed in as the parameter, so the memory passed to the native function is
full of garbage data. After the native method returns, the native memory is
copied back to java, which is usually not a problem, since the native function
will have updated the memory with valid data. However, if the native function
fails, the garbage data that was in the temporary native memory will be copied
back to java.
Copyright © 2017. All rights reserved.