From 11dde1bb18eaf7a6981bc5e7e46cc7d945d55182 Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Wed, 24 Nov 2004 10:44:18 +0000 Subject: NIOServerSocket.java: Added email to @author tag. 2004-11-24 Michael Koch * gnu/java/nio/NIOServerSocket.java: Added email to @author tag. * java/nio/DirectByteBufferImpl.java: Moved native methods to java.nio.VMDirectByteBuffer class. * java/nio/MappedByteBufferImpl.java: Use native methods from java.nio.VMDirectByteBuffer class. * java/nio/VMDirectByteBuffer.java: New file, * java/nio/natDirectByteBufferImpl.cc: Moved all methods into java.nio.VMDirectByteBuffer class. * java/nio/channels/spi/AbstractSelectableChannel.java (register): Only re-use valid keys. * Makefile.am: Added java/nio/VMDirectByteBuffer.java. * Makefile.in: Regenerated. From-SVN: r91146 --- libjava/java/nio/natDirectByteBufferImpl.cc | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'libjava/java/nio/natDirectByteBufferImpl.cc') diff --git a/libjava/java/nio/natDirectByteBufferImpl.cc b/libjava/java/nio/natDirectByteBufferImpl.cc index 88f53fc..3119fde 100644 --- a/libjava/java/nio/natDirectByteBufferImpl.cc +++ b/libjava/java/nio/natDirectByteBufferImpl.cc @@ -16,56 +16,55 @@ details. */ #include #include -#include +#include using gnu::gcj::RawData; -using java::nio::DirectByteBufferImpl; RawData* -java::nio::DirectByteBufferImpl::allocateImpl (jint capacity) +java::nio::VMDirectByteBuffer::allocate (jint capacity) { return reinterpret_cast (::malloc (capacity)); } void -java::nio::DirectByteBufferImpl::freeImpl (gnu::gcj::RawData* address) +java::nio::VMDirectByteBuffer::free (gnu::gcj::RawData* address) { ::free (reinterpret_cast (address)); } jbyte -DirectByteBufferImpl::getImpl (RawData* address, jint index) +java::nio::VMDirectByteBuffer::get (RawData* address, jint index) { jbyte* pointer = reinterpret_cast (address) + index; return *pointer; } void -DirectByteBufferImpl::getImpl (RawData* address, jint index, - jbyteArray dst, jint offset, jint length) +java::nio::VMDirectByteBuffer::get (RawData* address, jint index, + jbyteArray dst, jint offset, jint length) { jbyte* src = reinterpret_cast (address) + index; memcpy (elements (dst) + offset, src, length); } void -java::nio::DirectByteBufferImpl::putImpl (gnu::gcj::RawData* address, - jint index, jbyte value) +java::nio::VMDirectByteBuffer::put (gnu::gcj::RawData* address, + jint index, jbyte value) { jbyte* pointer = reinterpret_cast (address) + index; *pointer = value; } RawData* -java::nio::DirectByteBufferImpl::adjustAddress (RawData* address, jint offset) +java::nio::VMDirectByteBuffer::adjustAddress (RawData* address, jint offset) { jbyte* start = reinterpret_cast (address) + offset; return reinterpret_cast(start); } void -java::nio::DirectByteBufferImpl::shiftDown -(RawData* address, jint dst_offset, jint src_offset, jint count) +java::nio::VMDirectByteBuffer::shiftDown (RawData* address, jint dst_offset, + jint src_offset, jint count) { jbyte* dst = reinterpret_cast (address) + dst_offset; jbyte* src = reinterpret_cast (address) + src_offset; -- cgit v1.1