1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00

Bug 443687. Calculate the maximum partition size to decide if a tail

partition is required.

Change-Id: I43daed0ce0366ea0ab5aa6a437eb2f152e8012fc
Signed-off-by: abeerbagul <abeerbagul@gmail.com>
Reviewed-on: https://git.eclipse.org/r/33225
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
abeerbagul 2014-09-10 16:05:16 +05:30 committed by Marc Khouzam
parent d2f248dc70
commit 1ffa0a9bb2

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2010 Wind River Systems and others. * Copyright (c) 2006, 2014 Wind River Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -11,6 +11,7 @@
* Axel Mueller - Bug 306555 - Add support for cast to type / view as array (IExpressions2) * Axel Mueller - Bug 306555 - Add support for cast to type / view as array (IExpressions2)
* Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121) * Jens Elmenthaler (Verigy) - Added Full GDB pretty-printing support (bug 302121)
* Marc Khouzam (Ericsson) - Added support for expression aliases for return values of functions (bug 341731) * Marc Khouzam (Ericsson) - Added support for expression aliases for return values of functions (bug 341731)
* Abeer Bagul (Tensilica) - Extra partition created for arrays of length 20000 or greater (Bug 443687)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.mi.service; package org.eclipse.cdt.dsf.mi.service;
@ -1934,10 +1935,12 @@ public class MIExpressions extends AbstractDsfService implements IMIExpressions,
private int computeNumberOfChildren(int realNumberOfChildren) { private int computeNumberOfChildren(int realNumberOfChildren) {
int childNum = realNumberOfChildren; int childNum = realNumberOfChildren;
int partLength = getArrayPartitionLength(); int partLength = getArrayPartitionLength();
int maxPartitionLength = 1;
while (childNum > partLength) { while (childNum > partLength) {
childNum /= partLength; childNum /= partLength;
maxPartitionLength *= partLength;
} }
if (childNum*partLength < realNumberOfChildren) if (childNum*maxPartitionLength < realNumberOfChildren)
++childNum; ++childNum;
return childNum; return childNum;
} }