mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
util/disk_cache: move cache path strdup call back into disk_cache.c
This code is already OS agnostic and moving it here enables code sharing in the following patches. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7725>
This commit is contained in:
parent
48d7c4e0f3
commit
c1e4810221
2 changed files with 4 additions and 4 deletions
|
|
@ -107,6 +107,10 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
|
|||
if (!path)
|
||||
goto path_fail;
|
||||
|
||||
cache->path = ralloc_strdup(cache, path);
|
||||
if (cache->path == NULL)
|
||||
goto path_fail;
|
||||
|
||||
if (!disk_cache_mmap_cache_index(local, cache, path))
|
||||
goto path_fail;
|
||||
|
||||
|
|
|
|||
|
|
@ -930,10 +930,6 @@ disk_cache_mmap_cache_index(void *mem_ctx, struct disk_cache *cache,
|
|||
int fd = -1;
|
||||
bool mapped = false;
|
||||
|
||||
cache->path = ralloc_strdup(cache, path);
|
||||
if (cache->path == NULL)
|
||||
goto path_fail;
|
||||
|
||||
path = ralloc_asprintf(mem_ctx, "%s/index", cache->path);
|
||||
if (path == NULL)
|
||||
goto path_fail;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue