Changeset 1857 for trunk/src/kmk/make.h
- Timestamp:
- Oct 13, 2008, 5:58:07 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/make.h
r1854 r1857 511 511 #endif 512 512 #ifdef CONFIG_WITH_VALUE_LENGTH 513 struct strcache_pref 514 { 515 unsigned long hash1; 516 unsigned long hash2; 517 unsigned int len; 518 }; 519 520 int strcache_check_sanity (const char *str); 521 unsigned long strcache_get_hash2_fallback (const char *str); 522 513 523 MY_INLINE unsigned int strcache_get_len (const char *str) 514 524 { 515 unsigned int len = ((unsigned int *)str)[-1];516 MY_ASSERT_MSG (strcache_iscached (str), ("\n"));517 MY_ASSERT_MSG (str len (str) == len, ("\n"));525 struct strcache_pref const *prefix = (struct strcache_pref const *)str - 1; 526 unsigned int len = prefix->len; 527 MY_ASSERT_MSG (strcache_check_sanity (str) == 0, ("!\n")); 518 528 return len; 519 529 } 530 531 MY_INLINE unsigned int strcache_get_hash1 (const char *str) 532 { 533 struct strcache_pref const *prefix = (struct strcache_pref const *)str - 1; 534 unsigned long hash1 = prefix->hash1; 535 MY_ASSERT_MSG (strcache_check_sanity (str) == 0, ("!\n")); 536 return hash1; 537 } 538 539 MY_INLINE unsigned long strcache_get_hash2 (const char *str) 540 { 541 struct strcache_pref const *prefix = (struct strcache_pref const *)str - 1; 542 unsigned long hash2 = prefix->hash2; 543 MY_ASSERT_MSG (strcache_check_sanity (str) == 0, ("!\n")); 544 if (!hash2) 545 return strcache_get_hash2_fallback (str); 546 return hash2; 547 } 548 520 549 #endif 521 550
Note:
See TracChangeset
for help on using the changeset viewer.