Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] MIMemory oddity.

    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


Back to the top