[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
[cdt-dev] MIMemory oddity.
|
- From: Dave Korn <dave.korn.cygwin@xxxxxxxxx>
- Date: Fri, 18 May 2012 22:06:28 +0100
- Delivered-to: cdt-dev@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=5S6Y703HnyYDkyWRJWCjEJSz6J12UhnIUXScj76BA+w=; b=WB8t8USeCGjLid5pjyvNGFhqykcypaTdlkBPhpH34nBH69yRkkEFpJUWeWQMtAkQGy LqcrsZ6Tswqus5aXWQZT63dwedGKYbOvtAOUAdt3rznEOCVOyBOjMkdt+U3GsEy0Rp05 I+gqNpYACtrlQVdz2jRitg4W5j3gIGSl150Q5vDF9BRfN1Js1TS1A6VAmsKGpGajkwA0 uKt+G8shfm83QyRDc92O5yBBvT/i2ocfoQy9nItAfcTCq8yclRNFSVLnHvmVEMoYgr3F UcK3slhfPf1WvDytZt6qrIaZRYsm9pQVasdgmeP49iM/wlD4QWpZFWpwXWVWTumMPTBH NwWQ==
- User-agent: Thunderbird 2.0.0.17 (Windows/20080914)
Hello list,
I noticed something that looked strange in MIMemory.java
(org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service), in the
MIMemoryCache.getMemory method. There's a DataRequestMonitor handleSuccess
method in there that looks like this:
protected void handleSuccess() {
MemoryByte[] block = new MemoryByte[count];
block = getData();
MemoryBlock memoryBlock = new MemoryBlock(startAddress, length, block);
fMemoryBlockList.add(memoryBlock);
countingRM.done();
}
It looks to me like that's creating a new array of MemoryByte[count] and
then immediately discarding it, needlessly. I'm only asking in case there's
something I don't understand about java type resolution and generics. (And if
that were the case, surely a MemoryByte[0] would suffice?)
cheers,
DaveK