[m-rev.] for post-commit review: ssdb retry N

Peter Wang novalazy at gmail.com
Thu May 20 11:39:13 AEST 2010


On 2010-05-19, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
> 
> On Wed, 19 May 2010, Peter Wang wrote:
> >       Change the shadow stack representation from `stack(T)' to `list(T)' as
> >       the stack operations are too limited.
> 
> Is there a case to be made for adding extra operations to the stack
> module?  (Or are these the sort of operations that would violate the
> abstraction barrier with the stack ADT?)

In the end, I only needed list.det_index0, which is more convenient than
repeated calls to stack.pop.  So stack.nth_from_top would be nice.
I would also add stack.from_list and stack.to_list.

list is still a better choice in ssdb.m, because we don't have the
no-tag optimisation in Java.  stack would add an extra allocation per
call event.

> >       Consistently use the mutables that record the shadow stack depths.
> >       The old code made no sense and created performance problems by calling
> >       `stack.depth', which is O(n).
> 
> Perhaps we should consider storing the depth of the stack separately so
> that stack.depth is constant-time.

Maybe.

Peter
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list