OLD | NEW |
---|---|
1 // Copyright (c) 2005, 2007, Google Inc. | 1 // Copyright (c) 2005, 2007, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserv ed. | 3 // Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights reserv ed. |
4 // | 4 // |
5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
7 // met: | 7 // met: |
8 // | 8 // |
9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 // TODO: Better testing | 70 // TODO: Better testing |
71 // | 71 // |
72 // 9/28/2003 (new page-level allocator replaces ptmalloc2): | 72 // 9/28/2003 (new page-level allocator replaces ptmalloc2): |
73 // * malloc/free of small objects goes from ~300 ns to ~50 ns. | 73 // * malloc/free of small objects goes from ~300 ns to ~50 ns. |
74 // * allocation of a reasonably complicated struct | 74 // * allocation of a reasonably complicated struct |
75 // goes from about 1100 ns to about 300 ns. | 75 // goes from about 1100 ns to about 300 ns. |
76 | 76 |
77 #include "config.h" | 77 #include "config.h" |
78 #include "FastMalloc.h" | 78 #include "FastMalloc.h" |
79 | 79 |
80 #include "Assertions.h" | 80 #include "Assertions.h" |
abarth-chromium
2013/05/15 15:39:57
These includes should also use the "wtf/" prefix
| |
81 #include "wtf/CPU.h" | |
82 #include "wtf/StdLibExtras.h" | |
83 #include "wtf/UnusedParam.h" | |
81 | 84 |
82 #include <limits> | 85 #include <limits> |
83 #if OS(WINDOWS) | 86 #if OS(WINDOWS) |
84 #include <windows.h> | 87 #include <windows.h> |
85 #else | 88 #else |
86 #include <pthread.h> | 89 #include <pthread.h> |
87 #endif | 90 #endif |
88 #include <string.h> | 91 #include <string.h> |
89 #include <wtf/StdLibExtras.h> | |
90 #include <wtf/UnusedParam.h> | |
91 | 92 |
92 #ifndef NO_TCMALLOC_SAMPLES | 93 #ifndef NO_TCMALLOC_SAMPLES |
93 #define NO_TCMALLOC_SAMPLES | 94 #define NO_TCMALLOC_SAMPLES |
94 #endif | 95 #endif |
95 | 96 |
96 #if !USE(SYSTEM_MALLOC) && defined(NDEBUG) | 97 #if !USE(SYSTEM_MALLOC) && defined(NDEBUG) |
97 #define FORCE_SYSTEM_MALLOC 0 | 98 #define FORCE_SYSTEM_MALLOC 0 |
98 #else | 99 #else |
99 #define FORCE_SYSTEM_MALLOC 1 | 100 #define FORCE_SYSTEM_MALLOC 1 |
100 #endif | 101 #endif |
(...skipping 4100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4201 void FastMallocZone::init() | 4202 void FastMallocZone::init() |
4202 { | 4203 { |
4203 static FastMallocZone zone(pageheap, &thread_heaps, static_cast<TCMalloc_Cen tral_FreeListPadded*>(central_cache), &span_allocator, &threadheap_allocator); | 4204 static FastMallocZone zone(pageheap, &thread_heaps, static_cast<TCMalloc_Cen tral_FreeListPadded*>(central_cache), &span_allocator, &threadheap_allocator); |
4204 } | 4205 } |
4205 | 4206 |
4206 #endif // OS(DARWIN) | 4207 #endif // OS(DARWIN) |
4207 | 4208 |
4208 } // namespace WTF | 4209 } // namespace WTF |
4209 | 4210 |
4210 #endif // FORCE_SYSTEM_MALLOC | 4211 #endif // FORCE_SYSTEM_MALLOC |
OLD | NEW |