Alignment of addresses returned by SharedMemory::Map()

39 views
Skip to first unread message

Dale Curtis

unread,
Aug 16, 2012, 9:34:03 PM8/16/12
to Chromium-dev
Can it be assumed (CHECK()'d) that addresses returned by SharedMemory::Map() are always at least 16-byte aligned? My understanding is they are aligned to the platform page boundary, which in modern times is >> 16.

Thanks in advance,

- dale

John Bates

unread,
Aug 17, 2012, 12:16:44 PM8/17/12
to dalec...@chromium.org, Chromium-dev
That's my understanding as well. It also seems like a reasonable
guarantee for the Map API to provide. How about adding an expectation
to shared_memory_unittest.cc somewhere and run some try bots? If all
goes well you might add a note to the Map comments about minimum
alignment.

-John
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev

Dale Curtis

unread,
Aug 20, 2012, 1:19:40 PM8/20/12
to John Bates, Chromium-dev
Thanks John, to close the loop: I landed http://crrev.com/152218 which advertises a minimum alignment of 32-bytes. Per jar, it's still recommended callers counting on this use a CHECK() though.

- dale
Reply all
Reply to author
Forward
0 new messages