https://codereview.chromium.org/391413006/diff/40001/src/heap.cc
File src/heap.cc (right):

https://codereview.chromium.org/391413006/diff/40001/src/heap.cc#newcode5974
src/heap.cc:5974: GCTracer::Event::Event()
On 2014/07/22 15:57:24, ernstm wrote:
On 2014/07/22 15:21:30, Hannes Payer wrote:
> Why do we need the default constructor?

RingBuffer allocates an array of Events. The default constructor is
required for
that. We can leave the Events uninitialized, though.

Yes, I overlooked this one. Fine.

https://codereview.chromium.org/391413006/diff/40001/src/heap.h
File src/heap.h (right):

https://codereview.chromium.org/391413006/diff/40001/src/heap.h#newcode607
src/heap.h:607: end_ = (end_ + 1) % (MAX_SIZE + 1);
On 2014/07/22 15:57:25, ernstm wrote:
On 2014/07/22 15:21:31, Hannes Payer wrote:
> Hmm, MAX_SIZE+1 makes the code really complicated. And, the anchor
elements is
> just there until it gets overwritten (logically it is still there
after that).
I
> am wondering if it wouldn't be cleaner if we would handle the case
where there
> is no previous element externally... WDYT?

That is unrelated to anchor elements. The extra element is required to
correctly
handle wrap around cases in the ring buffer. Without the extra
element, we
couldn't distinguish an empty ring buffer from one that is completely
filled
(begin_ == end_ in both cases) and the iterator pointing to the first
element
would be identical to the end() iterator.

Ahm, yes. I guess we could also use a counter. But I am fine with what
you have.

But, I am not really convinced that we should have an anchor element. It
counts as a real element, i.e., you would have to add special handling
left and right o filter out the element. Wouldn't it be just simpler to
handle the empty case.

https://codereview.chromium.org/391413006/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to