Changeset 96577 in vbox
- Timestamp:
- Sep 2, 2022 11:47:43 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/bldprog-strtab-template.cpp.h
r96551 r96577 85 85 86 86 #ifdef BLDPROG_STRTAB_WITH_COMPRESSION 87 # include <iprt/asm.h>88 87 # include <map> 89 88 # include <iprt/sanitized/string> … … 186 185 187 186 187 #ifdef BLDPROG_STRTAB_WITH_COMPRESSION 188 189 /** 190 * Same as ASMBitTest. 191 * 192 * We cannot safely use ASMBitTest here because it must be inline, as this code 193 * is used to build RuntimeBldProg. */ 194 DECLINLINE(bool) BldProgBitIsSet(uint64_t const *pbmBitmap, size_t iBit) 195 { 196 return RT_BOOL(pbmBitmap[iBit / 64] & RT_BIT_64(iBit % 64)); 197 } 198 199 200 /** 201 * Same as ASMBitSet. 202 * 203 * We cannot safely use ASMBitSet here because it must be inline, as this code 204 * is used to build RuntimeBldProg. 205 */ 206 DECLINLINE(void) BldProgBitSet(uint64_t *pbmBitmap, size_t iBit) 207 { 208 pbmBitmap[iBit / 64] |= RT_BIT_64(iBit % 64); 209 } 210 211 #endif 212 213 188 214 /** 189 215 * Initializes the strint table compiler. … … 211 237 pThis->cMaxPendingStrings = cMaxStrings; 212 238 memset(pThis->bmUsedChars, 0, sizeof(pThis->bmUsedChars)); 213 ASMBitSet(pThis->bmUsedChars, 0); /* Some parts of the code still thinks zero is a terminator, so don't use it for now. */239 BldProgBitSet(pThis->bmUsedChars, 0); /* Some parts of the code still thinks zero is a terminator, so don't use it for now. */ 214 240 # ifndef BLDPROG_STRTAB_PURE_ASCII 215 ASMBitSet(pThis->bmUsedChars, 0xff); /* Reserve escape byte for codepoints above 127. */241 BldProgBitSet(pThis->bmUsedChars, 0xff); /* Reserve escape byte for codepoints above 127. */ 216 242 # endif 217 243 #endif … … 321 347 char ch; 322 348 while ((ch = *psz++) != '\0') 323 ASMBitSet(pThis->bmUsedChars, (uint8_t)ch);349 BldProgBitSet(pThis->bmUsedChars, (uint8_t)ch); 324 350 325 351 /* … … 797 823 char szTmp[2] = { (char)i, '\0' }; 798 824 const char *psz = szTmp; 799 if ( ASMBitTest(pThis->bmUsedChars, (int32_t)i)825 if ( BldProgBitIsSet(pThis->bmUsedChars, i) 800 826 || iDict >= SortedDict.m_cEntries) 801 827 { … … 1165 1191 for (unsigned i = 0; i < RT_ELEMENTS(pThis->aCompDict); i++) 1166 1192 { 1167 if ( ASMBitTest(pThis->bmUsedChars, (int32_t)i)1193 if (BldProgBitIsSet(pThis->bmUsedChars, i) 1168 1194 ? pThis->aCompDict[i].cchString != 1 : pThis->aCompDict[i].cchString < 1) 1169 1195 abort(); … … 1187 1213 #ifdef BLDPROG_STRTAB_WITH_COMPRESSION 1188 1214 for (unsigned i = 0; i < 0x100; i++) 1189 if (! ASMBitTest(pThis->bmUsedChars, (int32_t)i)) /* Encode table references using '\xYY'. */1215 if (!BldProgBitIsSet(pThis->bmUsedChars, i)) /* Encode table references using '\xYY'. */ 1190 1216 abCharCat[i] = 2; 1191 1217 #endif
Note:
See TracChangeset
for help on using the changeset viewer.