Changeset 46199 in vbox for trunk/src/VBox/Runtime/common/string
- Timestamp:
- May 21, 2013 7:49:19 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/strcache.cpp
r46198 r46199 75 75 */ 76 76 #define RTSTRCACHE_MERGED_THRESHOLD_BIT 6 77 78 79 /** The number of bytes (power of two) that the merged allocation lists should 80 * be grown by. Must be much greater than RTSTRCACHE_MERGED_THRESHOLD. */ 81 #define RTSTRCACHE_MERGED_GROW_SIZE _32K 82 /** The number of bytes (power of two) that the fixed allocation lists should 83 * be grown by. */ 84 #define RTSTRCACHE_FIXED_GROW_SIZE _32K 77 85 78 86 /** Validates a string cache handle, translating RTSTRCACHE_DEFAULT when found, … … 556 564 * cases, but it's too much effort to write and execute). 557 565 */ 558 size_t const cbChunk = RTSTRCACHE_ HEAP_THRESHOLD * 16;AssertReturn(cbChunk > cbEntry * 2, NULL);566 size_t const cbChunk = RTSTRCACHE_MERGED_GROW_SIZE; AssertReturn(cbChunk > cbEntry * 2, NULL); 559 567 PRTSTRCACHECHUNK pChunk = (PRTSTRCACHECHUNK)RTMemPageAlloc(cbChunk); 560 568 if (!pChunk) … … 628 636 if (!pFree) 629 637 { 630 PRTSTRCACHECHUNK pChunk = (PRTSTRCACHECHUNK)RTMemPageAlloc( PAGE_SIZE);638 PRTSTRCACHECHUNK pChunk = (PRTSTRCACHECHUNK)RTMemPageAlloc(RTSTRCACHE_FIXED_GROW_SIZE); 631 639 if (!pChunk) 632 640 return NULL; … … 762 770 if (cbEntry >= RTSTRCACHE_MERGED_THRESHOLD_BIT) 763 771 { 764 if (cbEntry < RTSTRCACHE_HEAP_THRESHOLD * 2)772 if (cbEntry <= RTSTRCACHE_HEAP_THRESHOLD) 765 773 pEntry = rtStrCacheAllocMergedEntry(pThis, uHash, pchString, cchString, cbEntry); 766 774 else
Note:
See TracChangeset
for help on using the changeset viewer.