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

Side by Side Diff: Source/wtf/PartitionAlloc.h

Issue 16896019: Replace RenderArena with PartitionAlloc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 PartitionBucket seedBucket; 130 PartitionBucket seedBucket;
131 PartitionBucket buckets[kNumBuckets]; 131 PartitionBucket buckets[kNumBuckets];
132 char* nextSuperPage; 132 char* nextSuperPage;
133 char* nextPartitionPage; 133 char* nextPartitionPage;
134 char* nextPartitionPageEnd; 134 char* nextPartitionPageEnd;
135 bool initialized; 135 bool initialized;
136 }; 136 };
137 137
138 WTF_EXPORT void partitionAllocInit(PartitionRoot*); 138 WTF_EXPORT void partitionAllocInit(PartitionRoot*);
139 WTF_EXPORT void partitionAllocShutdown(PartitionRoot*); 139 WTF_EXPORT void partitionAllocShutdown(PartitionRoot*);
140 WTF_EXPORT size_t partitionAllocGetUsedPagesSize(const PartitionRoot&);
140 141
141 WTF_EXPORT NEVER_INLINE void* partitionAllocSlowPath(PartitionBucket*); 142 WTF_EXPORT NEVER_INLINE void* partitionAllocSlowPath(PartitionBucket*);
142 WTF_EXPORT NEVER_INLINE void partitionFreeSlowPath(PartitionPageHeader*); 143 WTF_EXPORT NEVER_INLINE void partitionFreeSlowPath(PartitionPageHeader*);
143 144
144 ALWAYS_INLINE PartitionFreelistEntry* partitionFreelistMask(PartitionFreelistEnt ry* ptr) 145 ALWAYS_INLINE PartitionFreelistEntry* partitionFreelistMask(PartitionFreelistEnt ry* ptr)
145 { 146 {
146 // For now, use a simple / fast mask that guarantees an invalid pointer in 147 // For now, use a simple / fast mask that guarantees an invalid pointer in
147 // case it gets used as a vtable pointer. 148 // case it gets used as a vtable pointer.
148 // The one attack we're fully mitigating is where an object is freed and its 149 // The one attack we're fully mitigating is where an object is freed and its
149 // vtable used where the attacker doesn't get the chance to run allocations 150 // vtable used where the attacker doesn't get the chance to run allocations
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 217
217 } // namespace WTF 218 } // namespace WTF
218 219
219 using WTF::PartitionRoot; 220 using WTF::PartitionRoot;
220 using WTF::partitionAllocInit; 221 using WTF::partitionAllocInit;
221 using WTF::partitionAllocShutdown; 222 using WTF::partitionAllocShutdown;
222 using WTF::partitionAlloc; 223 using WTF::partitionAlloc;
223 using WTF::partitionFree; 224 using WTF::partitionFree;
224 225
225 #endif // WTF_PartitionAlloc_h 226 #endif // WTF_PartitionAlloc_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698