This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/JDWP] JdwpConnection cleanup


Keith Seitz wrote:

I believe the attached patch addresses concerns over temporary
OutputStream allocations.



Yes, this looks better. At least by using reset() on the ByteArrayOutputStream we are eliminating one level of allocation and potential copying. Aaron managed to convince me that the ByteArrayOutputStream was better than using ByteBuffer, at least for now. However, there is still a bit too much copying going on - couldn't JdwpPacket.toBytes() write directly to the stream, instead of creating another temporary byte[]? That can be fixed in another patch, though.


The changes in this patch are reflected in
gnu.classpath.jdwp.event.Event submission.

Comments/questions/concerns?
Keith

ChangeLog
* gnu/classpath/jdwp/transport/JdwpConnection.java (sendPacket): Rename
to ...
(send): ... this.
(send): New overloaded method for sending Events.



I think I liked the old sendPacket() name better, but maybe thats just me :)


Otherwise, this looks OK.

Bryce


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]