[Soot-list] Confusion on ArrayPackedSet data structure

Sai Zhang racezhang at gmail.com
Sun Jan 17 18:42:57 EST 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20100117/3cd83f72/attachment.html 


More information about the Soot-list mailing list