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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #define BASE_VDSO_SUPPORT_H_ | 56 #define BASE_VDSO_SUPPORT_H_ |
57 | 57 |
58 #include <config.h> | 58 #include <config.h> |
59 #include "base/basictypes.h" | 59 #include "base/basictypes.h" |
60 #include "base/elf_mem_image.h" | 60 #include "base/elf_mem_image.h" |
61 | 61 |
62 #ifdef HAVE_ELF_MEM_IMAGE | 62 #ifdef HAVE_ELF_MEM_IMAGE |
63 | 63 |
64 #define HAVE_VDSO_SUPPORT 1 | 64 #define HAVE_VDSO_SUPPORT 1 |
65 | 65 |
| 66 #include <cstddef> |
66 #include <stdlib.h> // for NULL | 67 #include <stdlib.h> // for NULL |
67 | 68 |
68 namespace base { | 69 namespace base { |
69 | 70 |
70 // NOTE: this class may be used from within tcmalloc, and can not | 71 // NOTE: this class may be used from within tcmalloc, and can not |
71 // use any memory allocation routines. | 72 // use any memory allocation routines. |
72 class VDSOSupport { | 73 class VDSOSupport { |
73 public: | 74 public: |
74 VDSOSupport(); | 75 VDSOSupport(); |
75 | 76 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // Return current CPU, using (fast) __vdso_getcpu@LINUX_2.6 if present, | 147 // Return current CPU, using (fast) __vdso_getcpu@LINUX_2.6 if present, |
147 // otherwise use syscall(SYS_getcpu,...). | 148 // otherwise use syscall(SYS_getcpu,...). |
148 // May return -1 with errno == ENOSYS if the kernel doesn't | 149 // May return -1 with errno == ENOSYS if the kernel doesn't |
149 // support SYS_getcpu. | 150 // support SYS_getcpu. |
150 int GetCPU(); | 151 int GetCPU(); |
151 } // namespace base | 152 } // namespace base |
152 | 153 |
153 #endif // HAVE_ELF_MEM_IMAGE | 154 #endif // HAVE_ELF_MEM_IMAGE |
154 | 155 |
155 #endif // BASE_VDSO_SUPPORT_H_ | 156 #endif // BASE_VDSO_SUPPORT_H_ |
OLD | NEW |