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

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

Issue 9316021: Update the tcmalloc vendor branch to r144 (gperftools 2.0). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Reuploading 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
51 void Init(size_t cl); 56 void Init(size_t cl);
52 57
53 // These methods all do internal locking. 58 // These methods all do internal locking.
54 59
55 // Insert the specified range into the central freelist. N is the number of 60 // Insert the specified range into the central freelist. N is the number of
56 // elements in the range. RemoveRange() is the opposite operation. 61 // elements in the range. RemoveRange() is the opposite operation.
57 void InsertRange(void *start, void *end, int N); 62 void InsertRange(void *start, void *end, int N);
58 63
59 // Returns the actual number of fetched elements and sets *start and *end. 64 // Returns the actual number of fetched elements and sets *start and *end.
60 int RemoveRange(void **start, void **end, int N); 65 int RemoveRange(void **start, void **end, int N);
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 class CentralFreeListPaddedTo<0> : public CentralFreeList { 191 class CentralFreeListPaddedTo<0> : public CentralFreeList {
187 }; 192 };
188 193
189 class CentralFreeListPadded : public CentralFreeListPaddedTo< 194 class CentralFreeListPadded : public CentralFreeListPaddedTo<
190 sizeof(CentralFreeList) % 64> { 195 sizeof(CentralFreeList) % 64> {
191 }; 196 };
192 197
193 } // namespace tcmalloc 198 } // namespace tcmalloc
194 199
195 #endif // TCMALLOC_CENTRAL_FREELIST_H_ 200 #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