Changeset 41872 in webkit for trunk/JavaScriptCore/jit/ExecutableAllocator.h
- Timestamp:
- Mar 20, 2009, 3:56:27 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/ExecutableAllocator.h
r39450 r41872 40 40 41 41 namespace JSC { 42 43 inline size_t roundUpAllocationSize(size_t request, size_t granularity) 44 { 45 if ((std::numeric_limits<size_t>::max() - granularity) <= request) 46 CRASH(); // Allocation is too large 47 48 // Round up to next page boundary 49 size_t size = request + (granularity - 1); 50 size = size & ~(granularity - 1); 51 ASSERT(size >= request); 52 return size; 53 } 42 54 43 55 class ExecutablePool : public RefCounted<ExecutablePool> { … … 86 98 static Allocation systemAlloc(size_t n); 87 99 static void systemRelease(const Allocation& alloc); 88 89 inline size_t roundUpAllocationSize(size_t request, size_t granularity)90 {91 if ((std::numeric_limits<size_t>::max() - granularity) <= request)92 CRASH(); // Allocation is too large93 94 // Round up to next page boundary95 size_t size = request + (granularity - 1);96 size = size & ~(granularity - 1);97 ASSERT(size >= request);98 return size;99 }100 100 101 101 ExecutablePool(size_t n);
Note:
See TracChangeset
for help on using the changeset viewer.