Changeset 37804 in webkit for trunk/JavaScriptCore/wtf/FastMalloc.cpp
- Timestamp:
- Oct 22, 2008, 8:36:04 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/FastMalloc.cpp
r36406 r37804 175 175 #if !PLATFORM(WIN_OS) 176 176 #include <pthread.h> 177 #else 178 #include "windows.h" 177 179 #endif 178 180 179 181 namespace WTF { 180 182 181 183 void* tryFastMalloc(size_t n) 182 184 { … … 231 233 232 234 void releaseFastMallocFreeMemory() { } 235 236 #if HAVE(VIRTUALALLOC) 237 void* fastMallocExecutable(size_t n) 238 { 239 return VirtualAlloc(0, n, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); 240 } 241 242 void fastFreeExecutable(void* p) 243 { 244 VirtualFree(p, 0, MEM_RELEASE); 245 } 246 #else 247 void* fastMallocExecutable(size_t n) 248 { 249 return fastMalloc(n); 250 } 251 252 void fastFreeExecutable(void* p) 253 { 254 fastFree(p); 255 } 256 #endif 233 257 234 258 } // namespace WTF … … 3360 3384 return old_ptr; 3361 3385 } 3386 } 3387 3388 void* fastMallocExecutable(size_t n) 3389 { 3390 return malloc<false>(n); 3391 } 3392 3393 void fastFreeExecutable(void* p) 3394 { 3395 free(p); 3362 3396 } 3363 3397
Note:
See TracChangeset
for help on using the changeset viewer.