diff options
| author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-17 11:57:55 +0000 |
|---|---|---|
| committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-17 11:57:55 +0000 |
| commit | d1ca32cf1d8b6cada6737626c5673b402650037f (patch) | |
| tree | 41961278c02922d45da1f6d5d4aac0d2cff26883 /libjava | |
| parent | 63c6ab3ab001856f14c3113f97876690677e287d (diff) | |
| download | ppe42-gcc-d1ca32cf1d8b6cada6737626c5673b402650037f.tar.gz ppe42-gcc-d1ca32cf1d8b6cada6737626c5673b402650037f.zip | |
2004-11-17 Michael Koch <konqueror@gmx.de>
* java/nio/DirectByteBufferImpl.java
(owner): Updated comment.
(allocate): New method.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90804 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
| -rw-r--r-- | libjava/ChangeLog | 6 | ||||
| -rw-r--r-- | libjava/java/nio/DirectByteBufferImpl.java | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index d950e93ecf9..c39097bc503 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,11 @@ 2004-11-17 Michael Koch <konqueror@gmx.de> + * java/nio/DirectByteBufferImpl.java + (owner): Updated comment. + (allocate): New method. + +2004-11-17 Michael Koch <konqueror@gmx.de> + * java/net/URL.java (URL): Handle case when argument is null. 2004-11-17 Michael Koch <konqueror@gmx.de> diff --git a/libjava/java/nio/DirectByteBufferImpl.java b/libjava/java/nio/DirectByteBufferImpl.java index aad5dca1e5d..89be156d432 100644 --- a/libjava/java/nio/DirectByteBufferImpl.java +++ b/libjava/java/nio/DirectByteBufferImpl.java @@ -52,7 +52,7 @@ final class DirectByteBufferImpl extends ByteBuffer } } - /** Used by MappedByteBufferImpl to prevent premature GC. */ + /** Used by MappedByteBufferImpl and when slicing to prevent premature GC. */ protected Object owner; RawData address; @@ -73,6 +73,14 @@ final class DirectByteBufferImpl extends ByteBuffer this.owner = owner; } + /** + * Allocates a new direct byte buffer. + */ + public static ByteBuffer allocate(int capacity) + { + return new DirectByteBufferImpl(allocateImpl(capacity), capacity); + } + private static native RawData allocateImpl (int capacity); private static native void freeImpl (RawData address); |

