util/disk_cache: hash pointer size and gpu name into cache keys

This allows to get rid of the arch and gpu name directories.

v2: (Timothy Arceri) don't use an opaque data type to store
    pointer size and gpu name.

v3: (Timothy Arceri) use blob to store driver keys just make sure
    to store null terminator for strings, and make sure blob is
    defined by disk_cache and not it's users.

v4: (Timothy Arceri) fix typo, and make ptr_size a uint8_t.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Grazvydas Ignotas
2017-03-16 01:09:31 +02:00
committed by Timothy Arceri
parent feb716239e
commit 5136c09e70
3 changed files with 17 additions and 54 deletions

View File

@@ -43,23 +43,6 @@ typedef uint8_t cache_key[CACHE_KEY_SIZE];
struct disk_cache;
static inline const char *
get_arch_bitness_str(void)
{
if (sizeof(void *) == 4)
#ifdef __ILP32__
return "ilp-32";
#else
return "32";
#endif
if (sizeof(void *) == 8)
return "64";
/* paranoia check which will be dropped by the optimiser */
assert(!"unknown_arch");
return "unknown_arch";
}
static inline bool
disk_cache_get_function_timestamp(void *ptr, uint32_t* timestamp)
{