classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nio package and asynchronous io


From: Per Bothner
Subject: Re: nio package and asynchronous io
Date: Mon, 04 Feb 2002 14:24:32 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.7+) Gecko/20020125

Bryce McKinlay wrote:
Inlining the hasRemaining() and all its friends is easy because they are final, but the buf.get() is a bit harder because its a virtual method. However if we taught GCJ that the various methods in nio usually/always return a GCJMappedByteBuffer or whatever, it could inline the get() too and the whole things becomes no less efficient than a regular bounds-checked array acccess.

Why bound-checking?  We need to check that the current position is less
than the limit, but there is no need to check that the position is
less than the buffer size (capacity), sizne the limit is always less
than te capacity, at least if we assume a GCJMappedByteBuffer or
whatever.
--
        --Per Bothner
address@hidden   http://www.bothner.com/per/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]