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

Side by Side Diff: Source/wtf/FastMalloc.cpp

Issue 14810003: Move CPU() macro to it's own header from wtf/Platform.h (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move CPU() macro to it's own header from wtf/Platform.h Created 7 years, 7 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 | « Source/wtf/CPU.h ('k') | Source/wtf/MathExtras.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 (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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 // TODO: Bias reclamation to larger addresses 68 // TODO: Bias reclamation to larger addresses
69 // TODO: implement mallinfo/mallopt 69 // TODO: implement mallinfo/mallopt
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 "wtf/FastMalloc.h"
79 79
80 #include "Assertions.h" 80 #include "wtf/Assertions.h"
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
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
OLDNEW
« no previous file with comments | « Source/wtf/CPU.h ('k') | Source/wtf/MathExtras.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698