@Code( tryBlock = true, // Create a GlobalRef to the callback object. javaBeforeNative = "\t\tlong user_data = CallbackUtil.createGlobalRef(pfn_notify);", // Check if we need to delete the GlobalRef. javaFinally = "\t\t\tCallbackUtil.checkCallback(__result, user_data);" ) @cl_int int clSetMemObjectDestructorAPPLE(@PointerWrapper("cl_mem") CLMem memobj, @PointerWrapper("cl_mem_object_destructor_callback") CLMemObjectDestructorCallback pfn_notify, @Constant("user_data") @PointerWrapper("void *") long user_data);