diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-18 02:17:26 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-18 02:17:26 +0000 |
commit | 404a05868f5bf1ccdae11e1bed771d55320ad72a (patch) | |
tree | bc19e1512f942357ffedee212b4f40ea1b33e980 /base/shared_memory.h | |
parent | 258082aba49773ac149a8df5803958ece232c870 (diff) | |
download | chromium_src-404a05868f5bf1ccdae11e1bed771d55320ad72a.zip chromium_src-404a05868f5bf1ccdae11e1bed771d55320ad72a.tar.gz chromium_src-404a05868f5bf1ccdae11e1bed771d55320ad72a.tar.bz2 |
Advertise a minimum alignment for SharedMemory::Map().
No real changes, just adds a DCHECK() and unit test for a minimum
alignment that callers can count on from Map(). Map() is already
returning addresses which are aligned to the platform page size.
Necessary for a media use case in which a wrapped shared memory
object is passed around and is expected to have a certain alignment.
BUG=none
TEST=unittests, try bots.
Review URL: https://chromiumcodereview.appspot.com/10827400
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152218 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/shared_memory.h')
-rw-r--r-- | base/shared_memory.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/base/shared_memory.h b/base/shared_memory.h index e1c0833..1f8237e 100644 --- a/base/shared_memory.h +++ b/base/shared_memory.h @@ -142,8 +142,10 @@ class BASE_EXPORT SharedMemory { // Maps the shared memory into the caller's address space. // Returns true on success, false otherwise. The memory address - // is accessed via the memory() accessor. + // is accessed via the memory() accessor. The mapped address is guaranteed to + // have an alignment of at least MAP_MINIMUM_ALIGNMENT. bool Map(uint32 bytes); + enum { MAP_MINIMUM_ALIGNMENT = 32 }; // Unmaps the shared memory from the caller's address space. // Returns true if successful; returns false on error or if the |