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

Side by Side Diff: third_party/tcmalloc/chromium/src/base/vdso_support.h

Issue 1578163002: Enable tcmalloc VDSO support only on x86 to reduce static initializers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ghh, comment Created 4 years, 11 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 | « third_party/tcmalloc/README.chromium ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 #ifndef BASE_VDSO_SUPPORT_H_ 55 #ifndef BASE_VDSO_SUPPORT_H_
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 // This matches the same conditions of stacktrace_x86-inl.h, the only client of
65 // vdso_support, to avoid static initializers.
66 #if defined(__linux__) && defined(__i386__)
64 #define HAVE_VDSO_SUPPORT 1 67 #define HAVE_VDSO_SUPPORT 1
68 #endif
65 69
66 #include <stdlib.h> // for NULL 70 #include <stdlib.h> // for NULL
67 71
68 namespace base { 72 namespace base {
69 73
70 // NOTE: this class may be used from within tcmalloc, and can not 74 // NOTE: this class may be used from within tcmalloc, and can not
71 // use any memory allocation routines. 75 // use any memory allocation routines.
72 class VDSOSupport { 76 class VDSOSupport {
73 public: 77 public:
74 VDSOSupport(); 78 VDSOSupport();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // Return current CPU, using (fast) __vdso_getcpu@LINUX_2.6 if present, 150 // Return current CPU, using (fast) __vdso_getcpu@LINUX_2.6 if present,
147 // otherwise use syscall(SYS_getcpu,...). 151 // otherwise use syscall(SYS_getcpu,...).
148 // May return -1 with errno == ENOSYS if the kernel doesn't 152 // May return -1 with errno == ENOSYS if the kernel doesn't
149 // support SYS_getcpu. 153 // support SYS_getcpu.
150 int GetCPU(); 154 int GetCPU();
151 } // namespace base 155 } // namespace base
152 156
153 #endif // HAVE_ELF_MEM_IMAGE 157 #endif // HAVE_ELF_MEM_IMAGE
154 158
155 #endif // BASE_VDSO_SUPPORT_H_ 159 #endif // BASE_VDSO_SUPPORT_H_
OLDNEW
« no previous file with comments | « third_party/tcmalloc/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698