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

Side by Side Diff: mojo/edk/system/memory.cc

Issue 2093763002: Implement WaitSetDispatcher::WaitSetWaitImpl(). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: doh Created 4 years, 5 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
« no previous file with comments | « no previous file | mojo/edk/system/shared_buffer_dispatcher.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/edk/system/memory.h" 5 #include "mojo/edk/system/memory.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 22 matching lines...) Expand all
33 void CheckUserPointerWithCount(const void* pointer, size_t count) { 33 void CheckUserPointerWithCount(const void* pointer, size_t count) {
34 CHECK_LE(count, std::numeric_limits<size_t>::max() / size); 34 CHECK_LE(count, std::numeric_limits<size_t>::max() / size);
35 CHECK(count == 0 || (pointer && IsAligned<alignment>(pointer))); 35 CHECK(count == 0 || (pointer && IsAligned<alignment>(pointer)));
36 } 36 }
37 37
38 // Explicitly instantiate the sizes we need. Add instantiations as needed. 38 // Explicitly instantiate the sizes we need. Add instantiations as needed.
39 template void CheckUserPointerWithCount<1, 1>(const void*, size_t); 39 template void CheckUserPointerWithCount<1, 1>(const void*, size_t);
40 template void CheckUserPointerWithCount<4, 4>(const void*, size_t); 40 template void CheckUserPointerWithCount<4, 4>(const void*, size_t);
41 template void CheckUserPointerWithCount<8, 4>(const void*, size_t); 41 template void CheckUserPointerWithCount<8, 4>(const void*, size_t);
42 template void CheckUserPointerWithCount<8, 8>(const void*, size_t); 42 template void CheckUserPointerWithCount<8, 8>(const void*, size_t);
43 template void CheckUserPointerWithCount<24, 8>(const void*, size_t);
43 44
44 template <size_t alignment> 45 template <size_t alignment>
45 void CheckUserPointerWithSize(const void* pointer, size_t size) { 46 void CheckUserPointerWithSize(const void* pointer, size_t size) {
46 // TODO(vtl): If running in kernel mode, do a full verification. For now, just 47 // TODO(vtl): If running in kernel mode, do a full verification. For now, just
47 // check that it's non-null and aligned. (A faster user mode implementation is 48 // check that it's non-null and aligned. (A faster user mode implementation is
48 // also possible if this check is skipped.) 49 // also possible if this check is skipped.)
49 CHECK(size == 0 || (!!pointer && internal::IsAligned<alignment>(pointer))); 50 CHECK(size == 0 || (!!pointer && internal::IsAligned<alignment>(pointer)));
50 } 51 }
51 52
52 // Explicitly instantiate the sizes we need. Add instantiations as needed. 53 // Explicitly instantiate the sizes we need. Add instantiations as needed.
53 template void CheckUserPointerWithSize<1>(const void*, size_t); 54 template void CheckUserPointerWithSize<1>(const void*, size_t);
54 template void CheckUserPointerWithSize<4>(const void*, size_t); 55 template void CheckUserPointerWithSize<4>(const void*, size_t);
55 template void CheckUserPointerWithSize<8>(const void*, size_t); 56 template void CheckUserPointerWithSize<8>(const void*, size_t);
56 57
57 } // namespace internal 58 } // namespace internal
58 } // namespace system 59 } // namespace system
59 } // namespace mojo 60 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/edk/system/shared_buffer_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698