Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: mojo/system/memory.h

Issue 23621056: Initial in-process implementation of some Mojo primitives. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: C++ wrappers Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MOJO_SYSTEM_MEMORY_H_
6 #define MOJO_SYSTEM_MEMORY_H_
7
8 #include <stddef.h>
9
10 namespace mojo {
11 namespace system {
12
13 // Verify that |count * size_each| bytes can be read from the user |pointer|
14 // insofar as possible/necessary. |count| and |size_each| are specified
15 // separately instead of a single size, since |count * size_each| may overflow a
16 // |size_t|. |count| may be zero but |size_each| must be nonzero.
17 //
18 // For example, if running in kernel mode, this should be a full verification
19 // that the given memory is owned and readable by the user process. In user
20 // mode, if crashes are acceptable, this may do nothing at all (and always
21 // return true).
22 bool VerifyUserPointer(const void* pointer, size_t count, size_t size_each);
23
24 } // namespace system
25 } // namespace mojo
26
27 #endif // MOJO_SYSTEM_MEMORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698