儲存庫 vbox 的更動 87186
- 時間撮記:
- 2021-1-6 下午12:47:49 (4 年 以前)
- svn:sync-xref-src-repo-rev:
- 142117
- 位置:
- trunk/src/VBox/Runtime
- 檔案:
-
- 修改 1 筆資料
- 複製 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Runtime/Makefile.kmk
r87185 r87186 772 772 common/asm/ASMMemFill32-generic.cpp \ 773 773 common/asm/ASMMemFirstMismatchingU8-generic.cpp \ 774 common/asm/ASMMemFirstNonZero-generic.cpp \ 774 775 common/misc/zero-alt.S 775 776 RuntimeR3_SOURCES.arm64 := \ … … 778 779 common/asm/ASMMemFill32-generic.cpp \ 779 780 common/asm/ASMMemFirstMismatchingU8-generic.cpp \ 781 common/asm/ASMMemFirstNonZero-generic.cpp \ 780 782 common/misc/zero-alt.S 781 783 RuntimeR3_SOURCES.sparc32 += \ -
trunk/src/VBox/Runtime/common/asm/ASMMemFirstNonZero-generic.cpp
r87185 r87186 33 33 34 34 35 DECLASM(void *) ASMMemFirstMismatchingU8(void const RT_FAR *pv, size_t cb, uint8_t u8) RT_NOTHROW_DEF35 DECLASM(void RT_FAR *) ASMMemFirstNonZero(void const RT_FAR *pv, size_t cb) RT_NOTHROW_DEF 36 36 { 37 37 uint8_t const *pb = (uint8_t const RT_FAR *)pv; 38 39 /* 40 * If we've got a large buffer to search, do it in larger units. 41 */ 42 if (cb >= sizeof(size_t) * 2) 43 { 44 /* Align the pointer: */ 45 while ((uintptr_t)pb & (sizeof(size_t) - 1)) 46 { 47 if (RT_LIKELY(*pb == 0)) 48 { /* likely */ } 49 else 50 return (void RT_FAR *)pb; 51 cb--; 52 pb++; 53 } 54 55 /* Scan in size_t sized words: */ 56 while ( cb >= sizeof(size_t) 57 && *(size_t *)pb == 0) 58 { 59 pb += sizeof(size_t); 60 cb -= sizeof(size_t); 61 } 62 } 63 64 /* 65 * Search byte by byte. 66 */ 38 67 for (; cb; cb--, pb++) 39 if (RT_LIKELY(*pb == u8))68 if (RT_LIKELY(*pb == 0)) 40 69 { /* likely */ } 41 70 else 42 return (void *)pb; 71 return (void RT_FAR *)pb; 72 43 73 return NULL; 44 74 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器