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

Side by Side Diff: third_party/tcmalloc/vendor/src/central_freelist.h

Issue 9701040: Revert 126715 - Update the tcmalloc vendor branch to r144 (gperftools 2.0). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
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 30 matching lines...) Expand all
41 #include "base/spinlock.h" 41 #include "base/spinlock.h"
42 #include "base/thread_annotations.h" 42 #include "base/thread_annotations.h"
43 #include "common.h" 43 #include "common.h"
44 #include "span.h" 44 #include "span.h"
45 45
46 namespace tcmalloc { 46 namespace tcmalloc {
47 47
48 // Data kept per size-class in central cache. 48 // Data kept per size-class in central cache.
49 class CentralFreeList { 49 class CentralFreeList {
50 public: 50 public:
51 // A CentralFreeList may be used before its constructor runs.
52 // So we prevent lock_'s constructor from doing anything to the
53 // lock_ state.
54 CentralFreeList() : lock_(base::LINKER_INITIALIZED) { }
55
56 void Init(size_t cl); 51 void Init(size_t cl);
57 52
58 // These methods all do internal locking. 53 // These methods all do internal locking.
59 54
60 // Insert the specified range into the central freelist. N is the number of 55 // Insert the specified range into the central freelist. N is the number of
61 // elements in the range. RemoveRange() is the opposite operation. 56 // elements in the range. RemoveRange() is the opposite operation.
62 void InsertRange(void *start, void *end, int N); 57 void InsertRange(void *start, void *end, int N);
63 58
64 // Returns the actual number of fetched elements and sets *start and *end. 59 // Returns the actual number of fetched elements and sets *start and *end.
65 int RemoveRange(void **start, void **end, int N); 60 int RemoveRange(void **start, void **end, int N);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 class CentralFreeListPaddedTo<0> : public CentralFreeList { 186 class CentralFreeListPaddedTo<0> : public CentralFreeList {
192 }; 187 };
193 188
194 class CentralFreeListPadded : public CentralFreeListPaddedTo< 189 class CentralFreeListPadded : public CentralFreeListPaddedTo<
195 sizeof(CentralFreeList) % 64> { 190 sizeof(CentralFreeList) % 64> {
196 }; 191 };
197 192
198 } // namespace tcmalloc 193 } // namespace tcmalloc
199 194
200 #endif // TCMALLOC_CENTRAL_FREELIST_H_ 195 #endif // TCMALLOC_CENTRAL_FREELIST_H_
OLDNEW
« no previous file with comments | « third_party/tcmalloc/vendor/src/base/sysinfo.cc ('k') | third_party/tcmalloc/vendor/src/central_freelist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698