public abstract class AbstractOpenCLObject extends java.lang.Object implements OpenCLObject
OpenCLObject
providing the release
mechanisms.OpenCLObject.ObjectReleaser
Modifier and Type | Field and Description |
---|---|
protected OpenCLObject.ObjectReleaser |
releaser |
Modifier | Constructor and Description |
---|---|
protected |
AbstractOpenCLObject(OpenCLObject.ObjectReleaser releaser) |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
OpenCLObject.ObjectReleaser |
getReleaser()
Returns the releaser object.
|
AbstractOpenCLObject |
register()
Registers this object for automatic releasing on garbage collection.
|
void |
release()
Releases this native object.
|
protected final OpenCLObject.ObjectReleaser releaser
protected AbstractOpenCLObject(OpenCLObject.ObjectReleaser releaser)
public AbstractOpenCLObject register()
OpenCLObject
OpenCLObjectManager
, you have to release it manually
by calling OpenCLObject.release()
.
Without registering or releasing, a memory leak might occur.
this
to allow calls like
Buffer buffer = clContext.createBuffer(1024).register();
.register
in interface OpenCLObject
this
public void release()
OpenCLObject
getReleaser().release()
.release
in interface OpenCLObject
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public OpenCLObject.ObjectReleaser getReleaser()
OpenCLObject
getReleaser
in interface OpenCLObject