Chromium Code Reviews| Index: base/shared_memory.h |
| diff --git a/base/shared_memory.h b/base/shared_memory.h |
| index 4eefdbb68bde5d69bd65d79e48650e8ba1b7abc4..a13cb0456ebf709cc97db9849691d900e6516574 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 MapFrom(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 MapFrom(off_t offset, size_t bytes); |
|
Mark Mentovai
2013/01/15 21:51:42
Isn’t this more MapAt than MapFrom?
Vitaly Buka (NO REVIEWS)
2013/01/15 22:13:05
Done.
Ideally I'd included offest to Map() interf
|
| enum { MAP_MINIMUM_ALIGNMENT = 32 }; |
| // Unmaps the shared memory from the caller's address space. |