OLD | NEW |
1 // Copyright (c) 2008, Google Inc. | 1 // Copyright (c) 2008, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 15 matching lines...) Expand all Loading... |
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | 29 |
30 // --- | 30 // --- |
31 // Author: Sanjay Ghemawat <opensource@google.com> | 31 // Author: Sanjay Ghemawat <opensource@google.com> |
32 | 32 |
33 #include "config.h" | 33 #include "config.h" |
34 #include "common.h" | 34 #include "common.h" |
35 #include "system-alloc.h" | 35 #include "system-alloc.h" |
| 36 #include <cstddef> |
36 | 37 |
37 #if defined(HAVE_UNISTD_H) && defined(HAVE_GETPAGESIZE) | 38 #if defined(HAVE_UNISTD_H) && defined(HAVE_GETPAGESIZE) |
38 #include <unistd.h> // for getpagesize | 39 #include <unistd.h> // for getpagesize |
39 #endif | 40 #endif |
40 | 41 |
41 namespace tcmalloc { | 42 namespace tcmalloc { |
42 | 43 |
43 // Note: the following only works for "n"s that fit in 32-bits, but | 44 // Note: the following only works for "n"s that fit in 32-bits, but |
44 // that is fine since we only use it for small sizes. | 45 // that is fine since we only use it for small sizes. |
45 static inline int LgFloor(size_t n) { | 46 static inline int LgFloor(size_t n) { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 return result; | 208 return result; |
208 } | 209 } |
209 | 210 |
210 uint64_t metadata_system_bytes() { return metadata_system_bytes_; } | 211 uint64_t metadata_system_bytes() { return metadata_system_bytes_; } |
211 | 212 |
212 void increment_metadata_system_bytes(size_t bytes) { | 213 void increment_metadata_system_bytes(size_t bytes) { |
213 metadata_system_bytes_ += bytes; | 214 metadata_system_bytes_ += bytes; |
214 } | 215 } |
215 | 216 |
216 } // namespace tcmalloc | 217 } // namespace tcmalloc |
OLD | NEW |