VirtualBox

Changeset 103013 in vbox for trunk/src


Ignore:
Timestamp:
Jan 24, 2024 12:50:12 AM (11 months ago)
Author:
vboxsync
Message:

iprt/asm-mem.h,zip.cpp,tstRTInlineAsm.cpp: Eliminated unused ASMMemIsZeroPage function.

Location:
trunk/src/VBox/Runtime
Files:
2 edited

Legend:

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

    r98103 r103013  
    17701770            if (    cbSrc == _4K
    17711771                &&  !((uintptr_t)pvSrc & 15)
    1772                 &&  ASMMemIsZeroPage(pvSrc))
     1772                &&  ASMMemIsZero(pvSrc, _4K))
    17731773            {
    17741774                if (RT_UNLIKELY(cbDst < sizeof(s_abZero4K)))
  • trunk/src/VBox/Runtime/testcase/tstRTInlineAsm.cpp

    r103005 r103013  
    23982398            if (pPage->ab[i])
    23992399                RTTestFailed(g_hTest, "ASMMemZeroPage didn't clear byte at offset %#x!\n", i);
    2400         if (ASMMemIsZeroPage(pPage) != true)
    2401             RTTestFailed(g_hTest, "ASMMemIsZeroPage returns false after ASMMemZeroPage!\n");
     2400        if (ASMMemIsZero(pPage, RT_ASM_PAGE_SIZE) != true)
     2401            RTTestFailed(g_hTest, "ASMMemIsZero/RT_ASM_PAGE_SIZE returns false after ASMMemZeroPage!\n");
    24022402        if (ASMMemFirstMismatchingU32(pPage, sizeof(pPage), 0) != NULL)
    24032403            RTTestFailed(g_hTest, "ASMMemFirstMismatchingU32(,,0) returns non-NULL after ASMMemZeroPage!\n");
     
    24102410    RTTestISub("ASMMemZeroPage");
    24112411    DO_SIMPLE_TEST_NO_SUB_NO_STACK(tstASMMemZeroPageWorker, TSTPAGE);
    2412 }
    2413 
    2414 
    2415 static void tstASMMemIsZeroPage(RTTEST hTest)
    2416 {
    2417     RTTestSub(hTest, "ASMMemIsZeroPage");
    2418 
    2419     void *pvPage1 = RTTestGuardedAllocHead(hTest, PAGE_SIZE);
    2420     void *pvPage2 = RTTestGuardedAllocTail(hTest, PAGE_SIZE);
    2421     RTTESTI_CHECK_RETV(pvPage1 && pvPage2);
    2422 
    2423     memset(pvPage1, 0, PAGE_SIZE);
    2424     memset(pvPage2, 0, PAGE_SIZE);
    2425     RTTESTI_CHECK(ASMMemIsZeroPage(pvPage1));
    2426     RTTESTI_CHECK(ASMMemIsZeroPage(pvPage2));
    2427 
    2428     memset(pvPage1, 0xff, PAGE_SIZE);
    2429     memset(pvPage2, 0xff, PAGE_SIZE);
    2430     RTTESTI_CHECK(!ASMMemIsZeroPage(pvPage1));
    2431     RTTESTI_CHECK(!ASMMemIsZeroPage(pvPage2));
    2432 
    2433     memset(pvPage1, 0, PAGE_SIZE);
    2434     memset(pvPage2, 0, PAGE_SIZE);
    2435     for (unsigned off = 0; off < PAGE_SIZE; off++)
    2436     {
    2437         ((uint8_t *)pvPage1)[off] = 1;
    2438         RTTESTI_CHECK(!ASMMemIsZeroPage(pvPage1));
    2439         ((uint8_t *)pvPage1)[off] = 0;
    2440 
    2441         ((uint8_t *)pvPage2)[off] = 0x80;
    2442         RTTESTI_CHECK(!ASMMemIsZeroPage(pvPage2));
    2443         ((uint8_t *)pvPage2)[off] = 0;
    2444     }
    2445 
    2446     RTTestSubDone(hTest);
    24472412}
    24482413
     
    33333298
    33343299    tstASMMemZeroPage();
    3335     tstASMMemIsZeroPage(g_hTest);
    33363300    tstASMMemFirstMismatchingU8(g_hTest);
    33373301    tstASMMemZero32();
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