Changeset 46387 in webkit for trunk/JavaScriptCore/wtf/FastMalloc.cpp
- Timestamp:
- Jul 24, 2009, 6:49:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/FastMalloc.cpp
r46180 r46387 96 96 #endif 97 97 98 #define TCMALLOC_TRACK_DECOMMITED_SPANS (HAVE(VIRTUALALLOC) || HAVE(MADV_FREE_REUSE))99 100 98 #ifndef NDEBUG 101 99 namespace WTF { … … 1044 1042 }; 1045 1043 1046 #if TCMALLOC_TRACK_DECOMMITED_SPANS1047 1044 #define ASSERT_SPAN_COMMITTED(span) ASSERT(!span->decommitted) 1048 #else1049 #define ASSERT_SPAN_COMMITTED(span)1050 #endif1051 1045 1052 1046 #ifdef SPAN_HISTORY … … 1370 1364 Span* result = ll->next; 1371 1365 Carve(result, n, released); 1372 #if TCMALLOC_TRACK_DECOMMITED_SPANS1373 1366 if (result->decommitted) { 1374 1367 TCMalloc_SystemCommit(reinterpret_cast<void*>(result->start << kPageShift), static_cast<size_t>(n << kPageShift)); 1375 1368 result->decommitted = false; 1376 1369 } 1377 #endif1378 1370 ASSERT(Check()); 1379 1371 free_pages_ -= n; … … 1432 1424 if (best != NULL) { 1433 1425 Carve(best, n, from_released); 1434 #if TCMALLOC_TRACK_DECOMMITED_SPANS1435 1426 if (best->decommitted) { 1436 1427 TCMalloc_SystemCommit(reinterpret_cast<void*>(best->start << kPageShift), static_cast<size_t>(n << kPageShift)); 1437 1428 best->decommitted = false; 1438 1429 } 1439 #endif1440 1430 ASSERT(Check()); 1441 1431 free_pages_ -= n; … … 1462 1452 } 1463 1453 1464 #if !TCMALLOC_TRACK_DECOMMITED_SPANS1465 static ALWAYS_INLINE void propagateDecommittedState(Span*, Span*) { }1466 #else1467 1454 static ALWAYS_INLINE void propagateDecommittedState(Span* destination, Span* source) 1468 1455 { 1469 1456 destination->decommitted = source->decommitted; 1470 1457 } 1471 #endif1472 1458 1473 1459 inline void TCMalloc_PageHeap::Carve(Span* span, Length n, bool released) { … … 1496 1482 } 1497 1483 1498 #if !TCMALLOC_TRACK_DECOMMITED_SPANS1499 static ALWAYS_INLINE void mergeDecommittedStates(Span*, Span*) { }1500 #else1501 1484 static ALWAYS_INLINE void mergeDecommittedStates(Span* destination, Span* other) 1502 1485 { … … 1510 1493 } 1511 1494 } 1512 #endif1513 1495 1514 1496 inline void TCMalloc_PageHeap::Delete(Span* span) { … … 1557 1539 Event(span, 'D', span->length); 1558 1540 span->free = 1; 1559 #if TCMALLOC_TRACK_DECOMMITED_SPANS1560 1541 if (span->decommitted) { 1561 1542 if (span->length < kMaxPages) … … 1563 1544 else 1564 1545 DLL_Prepend(&large_.returned, span); 1565 } else 1566 #endif 1567 { 1546 } else { 1568 1547 if (span->length < kMaxPages) 1569 1548 DLL_Prepend(&free_[span->length].normal, span); … … 1597 1576 TCMalloc_SystemRelease(reinterpret_cast<void*>(s->start << kPageShift), 1598 1577 static_cast<size_t>(s->length << kPageShift)); 1599 #if TCMALLOC_TRACK_DECOMMITED_SPANS1600 1578 s->decommitted = true; 1601 #endif1602 1579 DLL_Prepend(&slist->returned, s); 1603 1580
Note:
See TracChangeset
for help on using the changeset viewer.