All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.javacpp.annotation.ArrayAllocator Maven / Gradle / Ivy

The newest version!
package com.googlecode.javacpp.annotation;

import com.googlecode.javacpp.Generator;
import com.googlecode.javacpp.Pointer;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * An annotation indicating that a method should behave like an array allocator.
 * However, methods with signature {@code native void allocateArray(int)} are
 * recognized as array allocators even without annotation. This behavior can be
 * changed by annotating the method with the {@link Function} annotation.
 * 

* In a nutshell, an array allocator uses the C++ {@code new[]} operator, and * initializes the {@link Pointer#address} as well as the {@link Pointer#deallocator} * with {@code NativeDeallocator}, based on the {@code delete[]} operator, if * not additionally annotated with {@link NoDeallocator}. * * @see Pointer#init(long, int, long) * @see Generator * * @author Samuel Audet */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD}) public @interface ArrayAllocator { }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy