https://codereview.chromium.org/1133243006/diff/20001/src/heap/heap.h
File src/heap/heap.h (right):

https://codereview.chromium.org/1133243006/diff/20001/src/heap/heap.h#newcode1084
src/heap/heap.h:1084: if (sizeof(int) < sizeof(int64_t) && total >
kMaxInt) {
On 2015/05/19 14:23:25, Jakob wrote:
Isn't "sizeof(int) < sizeof(int64_t)" true on all platforms? How about
we change

Oh yeah, good point.

the original line to:
if (total > std::numeric_limits<intptr_t>::max()) {
   return std::numeric_limits<intptr_t>::max();
}

Works for me.

https://codereview.chromium.org/1133243006/diff/20001/src/heap/heap.h#newcode1084
src/heap/heap.h:1084: if (sizeof(int) < sizeof(int64_t) && total >
kMaxInt) {
On 2015/05/19 14:41:46, Sven Panne wrote:
On 2015/05/19 14:23:25, Jakob wrote:
> Isn't "sizeof(int) < sizeof(int64_t)" true on all platforms?

Currently, yes (see http://www.unix.org/whitepapers/64bit.html), but
there's no
fundamental reason why there can't be an IP64 platform. :-}

> How about we change the original line to:
>
> if (total > std::numeric_limits<intptr_t>::max()) {
>   return std::numeric_limits<intptr_t>::max();
> }

Looks OK to me, but I'm really puzzled by all those types used for
sizes here
(int, int64_t, intptr_t), this looks really scary and error-prone.
Perhaps we
should consistently use (s)size_t or ptrdiff_t? o_O

Yes, see the TODO.  There's no difference between size_t and uintptr_t
on any sensible platform, but on a theoretical segmented platform
uintptr_t would be big enough to hold the size of all objects in all
segments, whereas size_t might only be big enough for the biggest object
in one segment.

https://codereview.chromium.org/1133243006/

--
--
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