/[classpath]/classpath/java/nio/DirectByteBufferImpl.java
ViewVC logotype

Diff of /classpath/java/nio/DirectByteBufferImpl.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by jfrijters, Mon Dec 27 14:35:30 2004 UTC revision 1.16 by mkoch, Wed Dec 29 11:45:12 2004 UTC
# Line 42  import gnu.classpath.RawData; Line 42  import gnu.classpath.RawData;
42    
43  abstract class DirectByteBufferImpl extends ByteBuffer  abstract class DirectByteBufferImpl extends ByteBuffer
44  {  {
45    /** The owner is used to keep alive the object that actually owns the    /**
46      * memory. There are three possibilities:     * The owner is used to keep alive the object that actually owns the
47      *  1) owner == this: We allocated the memory and we should free it,     * memory. There are three possibilities:
48      *                    but *only* in finalize (if we've been sliced     *  1) owner == this: We allocated the memory and we should free it,
49      *                    other objects will also have access to the     *                    but *only* in finalize (if we've been sliced
50      *                    memory).     *                    other objects will also have access to the
51      *  2) owner == null: The byte buffer was created thru     *                    memory).
52      *                    JNI.NewDirectByteBuffer. The JNI code is     *  2) owner == null: The byte buffer was created thru
53      *                    responsible for freeing the memory.     *                    JNI.NewDirectByteBuffer. The JNI code is
54      *  3) owner == some other object: The other object allocated the     *                    responsible for freeing the memory.
55      *                                 memory and should free it.     *  3) owner == some other object: The other object allocated the
56      */     *                                 memory and should free it.
57       */
58    private final Object owner;    private final Object owner;
59      
60    final RawData address;    final RawData address;
61    
62    final static class ReadOnly extends DirectByteBufferImpl    static final class ReadOnly extends DirectByteBufferImpl
63    {    {
64      ReadOnly(Object owner, RawData address,      ReadOnly(Object owner, RawData address,
65               int capacity, int limit,               int capacity, int limit,
# Line 82  abstract class DirectByteBufferImpl exte Line 84  abstract class DirectByteBufferImpl exte
84      }      }
85    }    }
86    
87    final static class ReadWrite extends DirectByteBufferImpl    static final class ReadWrite extends DirectByteBufferImpl
88    {    {
89      ReadWrite(int capacity)      ReadWrite(int capacity)
90      {      {

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26