/**
* Registers a callback which will be called by the OpenCL implementation
* when the memory object is released.
*/
public void registerDestructorCallback(final CLMemObjectListener listener) {
binding.clSetMemObjectDestructorCallback(ID, new CLMemObjectDestructorCallback() {
@Override
public void memoryDeallocated(long memObjID) {
listener.memoryDeallocated(CLMemory.this);
}
});