mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
Use 32-bit hashing in isc memory debugging
Switch from 64-bit isc_hash_function() to 32-bit isc_hash32() as we were using the 32-bit value only anyway.
This commit is contained in:
@@ -216,11 +216,11 @@ add_trace_entry(isc_mem_t *mctx, const void *ptr, size_t size FLARG) {
|
|||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
/*
|
/*
|
||||||
* Use simple conversion from pointer to hash to avoid
|
* Use simple conversion from pointer to hash to avoid
|
||||||
* tainting 'ptr' due to byte swap in isc_hash_function.
|
* tainting 'ptr' due to byte swap in isc_hash32.
|
||||||
*/
|
*/
|
||||||
hash = (uintptr_t)ptr >> 3;
|
hash = (uintptr_t)ptr >> 3;
|
||||||
#else
|
#else
|
||||||
hash = isc_hash_function(&ptr, sizeof(ptr), true);
|
hash = isc_hash32(&ptr, sizeof(ptr), true);
|
||||||
#endif
|
#endif
|
||||||
idx = hash % DEBUG_TABLE_COUNT;
|
idx = hash % DEBUG_TABLE_COUNT;
|
||||||
|
|
||||||
@@ -260,11 +260,11 @@ delete_trace_entry(isc_mem_t *mctx, const void *ptr, size_t size,
|
|||||||
#ifdef __COVERITY__
|
#ifdef __COVERITY__
|
||||||
/*
|
/*
|
||||||
* Use simple conversion from pointer to hash to avoid
|
* Use simple conversion from pointer to hash to avoid
|
||||||
* tainting 'ptr' due to byte swap in isc_hash_function.
|
* tainting 'ptr' due to byte swap in isc_hash32.
|
||||||
*/
|
*/
|
||||||
hash = (uintptr_t)ptr >> 3;
|
hash = (uintptr_t)ptr >> 3;
|
||||||
#else
|
#else
|
||||||
hash = isc_hash_function(&ptr, sizeof(ptr), true);
|
hash = isc_hash32(&ptr, sizeof(ptr), true);
|
||||||
#endif
|
#endif
|
||||||
idx = hash % DEBUG_TABLE_COUNT;
|
idx = hash % DEBUG_TABLE_COUNT;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user