- Timestamp:
- May 21, 2013 7:49:19 PM (12 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r46162 r46199 419 419 common/string/stringalloc.cpp \ 420 420 common/string/strprintf.cpp \ 421 common/string/strcache.cpp \ 421 422 common/string/strspace.cpp \ 422 423 common/string/strstrip.cpp \ … … 489 490 generic/semxroads-generic.cpp \ 490 491 generic/spinlock-generic.cpp \ 491 generic/strcache-stubs-generic.cpp \492 492 generic/timerlr-generic.cpp \ 493 493 r3/alloc-ef.cpp \ -
trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp
r46165 r46199 757 757 #endif 758 758 default: 759 rc = VERR_NOT_IMPLEMENTED; 759 760 break; 760 761 } -
trunk/src/VBox/Runtime/common/dbg/dbgmodexports.cpp
r46113 r46199 97 97 } 98 98 99 /* Add dummy segments for segments that doesn't get mapped. */ 100 if (pSeg->LinkAddress == NIL_RTLDRADDR) 101 return RTDbgModSegmentAdd(pArgs->pDbgMod, 0, 0, pszName, 0 /*fFlags*/, NULL); 102 99 103 RTLDRADDR cb = RT_MAX(pSeg->cb, pSeg->cbMapped); 100 104 return RTDbgModSegmentAdd(pArgs->pDbgMod, pSeg->RVA, cb, pszName, 0 /*fFlags*/, NULL); -
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 -
trunk/src/VBox/Runtime/testcase/tstRTStrCache.cpp
r44529 r46199 88 88 RTTESTI_CHECK(RTStrCacheRetain(psz) == 5); 89 89 RTTESTI_CHECK(RTStrCacheRetain(psz) == 6); 90 RTTESTI_CHECK(RTStrCacheRelease( NIL_RTSTRCACHE, psz) == 5);91 RTTESTI_CHECK(RTStrCacheRelease( NIL_RTSTRCACHE, psz) == 4);90 RTTESTI_CHECK(RTStrCacheRelease(hStrCache, psz) == 5); 91 RTTESTI_CHECK(RTStrCacheRelease(hStrCache, psz) == 4); 92 92 RTTESTI_CHECK_MSG_RETV((pv2 = ASMMemIsAll8(psz, i, 'a')) == NULL && !psz[i], ("i=%#x psz=%p off=%#x\n", i, psz, (uintptr_t)pv2 - (uintptr_t)psz)); 93 93 … … 107 107 } 108 108 } 109 } 110 111 /* Lots of allocations. */ 112 memset(szTest, 'b', sizeof(szTest)); 113 memset(szTest2, 'e', sizeof(szTest)); 114 const char *pszTest1Rets[4096 + 16]; 115 const char *pszTest2Rets[4096 + 16]; 116 for (uint32_t i = 1; i < RT_ELEMENTS(pszTest1Rets); i++) 117 { 118 RTTESTI_CHECK(pszTest1Rets[i] = RTStrCacheEnterN(hStrCache, szTest, i)); 119 RTTESTI_CHECK(strlen(pszTest1Rets[i]) == i); 120 RTTESTI_CHECK(pszTest2Rets[i] = RTStrCacheEnterN(hStrCache, szTest2, i)); 121 RTTESTI_CHECK(strlen(pszTest2Rets[i]) == i); 122 } 123 124 for (uint32_t i = 1; i < RT_ELEMENTS(pszTest1Rets); i++) 125 { 126 uint32_t cRefs; 127 RTTESTI_CHECK(strlen(pszTest1Rets[i]) == i); 128 RTTESTI_CHECK_MSG((cRefs = RTStrCacheRelease(hStrCache, pszTest1Rets[i])) == 0, ("cRefs=%#x i=%#x\n", cRefs, i)); 129 RTTESTI_CHECK(strlen(pszTest2Rets[i]) == i); 130 RTTESTI_CHECK_MSG((cRefs = RTStrCacheRelease(hStrCache, pszTest2Rets[i])) == 0, ("cRefs=%#x i=%#x\n", cRefs, i)); 109 131 } 110 132 }
Note:
See TracChangeset
for help on using the changeset viewer.