Skip to content

Commit 6cdb2b5

Browse files
committed
FlowDroid has less hunger for memory
1 parent f300756 commit 6cdb2b5

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

soot-infoflow/src/soot/jimple/infoflow/data/AccessPathFactory.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import org.slf4j.Logger;
88
import org.slf4j.LoggerFactory;
99

10+
import gnu.trove.set.hash.TCustomHashSet;
11+
import gnu.trove.strategy.HashingStrategy;
1012
import soot.ArrayType;
1113
import soot.Local;
1214
import soot.PrimType;
@@ -21,7 +23,6 @@
2123
import soot.jimple.StaticFieldRef;
2224
import soot.jimple.infoflow.InfoflowConfiguration;
2325
import soot.jimple.infoflow.InfoflowConfiguration.AccessPathConfiguration;
24-
import soot.jimple.infoflow.collect.ConcurrentHashSet;
2526
import soot.jimple.infoflow.collect.MyConcurrentHashMap;
2627
import soot.jimple.infoflow.data.AccessPath.ArrayTaintType;
2728
import soot.jimple.infoflow.typing.TypeUtils;
@@ -415,7 +416,20 @@ public AccessPath createAccessPath(Value val, Type valType, AccessPathFragment[]
415416
}
416417

417418
private void registerBase(Type eiType, AccessPathFragment[] base) {
418-
Set<AccessPathFragment[]> bases = baseRegister.computeIfAbsent(eiType, t -> new ConcurrentHashSet<>());
419+
Set<AccessPathFragment[]> bases = baseRegister.computeIfAbsent(eiType,
420+
t -> new TCustomHashSet<>(new HashingStrategy<AccessPathFragment[]>() {
421+
422+
@Override
423+
public int computeHashCode(AccessPathFragment[] arg0) {
424+
return Arrays.hashCode(arg0);
425+
}
426+
427+
@Override
428+
public boolean equals(AccessPathFragment[] arg0, AccessPathFragment[] arg1) {
429+
return Arrays.equals(arg0, arg1);
430+
}
431+
432+
}));
419433
bases.add(base);
420434
}
421435

0 commit comments

Comments
 (0)