VirtualBox

Ignore:
Timestamp:
May 21, 2013 7:49:19 PM (12 years ago)
Author:
vboxsync
Message:

strcache.cpp: Enabled it. Some tuning.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/strcache.cpp

    r46198 r46199  
    7575 */
    7676#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
    7785
    7886/** Validates a string cache handle, translating RTSTRCACHE_DEFAULT when found,
     
    556564         * cases, but it's too much effort to write and execute).
    557565         */
    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);
    559567        PRTSTRCACHECHUNK pChunk  = (PRTSTRCACHECHUNK)RTMemPageAlloc(cbChunk);
    560568        if (!pChunk)
     
    628636    if (!pFree)
    629637    {
    630         PRTSTRCACHECHUNK pChunk = (PRTSTRCACHECHUNK)RTMemPageAlloc(PAGE_SIZE);
     638        PRTSTRCACHECHUNK pChunk = (PRTSTRCACHECHUNK)RTMemPageAlloc(RTSTRCACHE_FIXED_GROW_SIZE);
    631639        if (!pChunk)
    632640            return NULL;
     
    762770        if (cbEntry >= RTSTRCACHE_MERGED_THRESHOLD_BIT)
    763771        {
    764             if (cbEntry < RTSTRCACHE_HEAP_THRESHOLD * 2)
     772            if (cbEntry <= RTSTRCACHE_HEAP_THRESHOLD)
    765773                pEntry = rtStrCacheAllocMergedEntry(pThis, uHash, pchString, cchString, cbEntry);
    766774            else
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette