Changeset 21096 in webkit for trunk/JavaScriptCore/wtf/FastMalloc.cpp
- Timestamp:
- Apr 25, 2007, 1:25:06 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/FastMalloc.cpp
r20351 r21096 286 286 // Return floor(log2(n)) for n > 0. 287 287 #if PLATFORM(X86) && COMPILER(GCC) 288 static inlineint LgFloor(size_t n) {288 static ALWAYS_INLINE int LgFloor(size_t n) { 289 289 // "ro" for the input spec means the input can come from either a 290 290 // register ("r") or offsetable memory ("o"). … … 299 299 300 300 #elif PLATFORM(PPC) && COMPILER(GCC) 301 static inlineint LgFloor(size_t n) {301 static ALWAYS_INLINE int LgFloor(size_t n) { 302 302 // "r" for the input spec means the input must come from a 303 303 // register ("r") … … 329 329 #endif 330 330 331 static inlinesize_t SizeClass(size_t size) {332 if (size == 0) size = 1;331 static ALWAYS_INLINE size_t SizeClass(size_t size) { 332 size += !size; // change 0 to 1 (with no branches) 333 333 const int lg = LgFloor(size); 334 334 const int align = size_shift[lg]; … … 337 337 338 338 // Get the byte-size for a specified class 339 static inlinesize_t ByteSizeForClass(size_t cl) {339 static ALWAYS_INLINE size_t ByteSizeForClass(size_t cl) { 340 340 return class_to_size[cl]; 341 341 }
Note:
See TracChangeset
for help on using the changeset viewer.