summaryrefslogtreecommitdiffstats
path: root/base/shared_memory.h
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-16 09:02:34 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-16 09:02:34 +0000
commite29e3f552af122c042dde824952e477ef6e5263c (patch)
treef300691f2bb8f2e4a24ec1830d02c741da1b25b2 /base/shared_memory.h
parentfb57c430ca3716272f812309c74c3d358bca5318 (diff)
downloadchromium_src-e29e3f552af122c042dde824952e477ef6e5263c.zip
chromium_src-e29e3f552af122c042dde824952e477ef6e5263c.tar.gz
chromium_src-e29e3f552af122c042dde824952e477ef6e5263c.tar.bz2
Added SharedMemory::MapFrom.
Fragmentation of address space may prevents process from allocate entire block of shared memory. Particularly in attached bug browser process can't allocate 250Mb to accept data from renderer Mapping smaller blocks is workaround. BUG=93202 Review URL: https://chromiumcodereview.appspot.com/11876037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/shared_memory.h')
-rw-r--r--base/shared_memory.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/base/shared_memory.h b/base/shared_memory.h
index 4eefdbb..30b1a89 100644
--- a/base/shared_memory.h
+++ b/base/shared_memory.h
@@ -144,7 +144,14 @@ class BASE_EXPORT SharedMemory {
// Returns true on success, false otherwise. The memory address
// is accessed via the memory() accessor. The mapped address is guaranteed to
// have an alignment of at least MAP_MINIMUM_ALIGNMENT.
- bool Map(size_t bytes);
+ bool Map(size_t bytes) {
+ return MapAt(0, bytes);
+ }
+
+ // Same as above, but with |offset| to specify from begining of the shared
+ // memory block to map.
+ // |offset| must be alignent to value of |SysInfo::VMAllocationGranularity()|.
+ bool MapAt(off_t offset, size_t bytes);
enum { MAP_MINIMUM_ALIGNMENT = 32 };
// Unmaps the shared memory from the caller's address space.