[Soot-list] Confusion on ArrayPackedSet data structure

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Mon Jan 18 02:46:12 EST 2010


Hello.

An ArrayPackedSet always models a subset of a fixed (!) universe. (as
you can see in the code) It does so using a fixed-size array.
Therefore you may only add items that are part of the universe. I hope
that answers your questions.

Eric

--
Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt



2010/1/18 Sai Zhang <racezhang at gmail.com>:
>
>
> Hi All:
>
> I am a bit confused on the ArrayPackedSet data structure. Consider the
> following
> code from soot example.
>
>         //local means all local declarations iniside a method body
>         Chain locals = g.getBody().getLocals();
>         FlowUniverse localUniverse = new
> ArrayFlowUniverse(locals.toArray());
>         this.emptySet = new ArrayPackedSet(localUniverse);
>
> Why "this.emptySet.size == 0" after the above statements?
>
> I the size() method of ArrayPackedSet class seems to involve several shift
> operations, instead
> of return the "elements" length directly. I am a bit confused about that.
>
> Also, the capacity of an ArrayPackedSet seems to be fixed, isn't it? That
> is, if you add
> too many items to that, an "array out of boundary" error will occur.
>
> Thanks
>
> -Sai
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


More information about the Soot-list mailing list