disk_cache: move munmap into an OS specific helper
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6197>
This commit is contained in:
parent
889356e731
commit
e1236470dc
|
@ -264,7 +264,7 @@ disk_cache_destroy(struct disk_cache *cache)
|
|||
if (cache && !cache->path_init_failed) {
|
||||
util_queue_finish(&cache->cache_queue);
|
||||
util_queue_destroy(&cache->cache_queue);
|
||||
munmap(cache->index_mmap, cache->index_mmap_size);
|
||||
disk_cache_destroy_mmap(cache);
|
||||
}
|
||||
|
||||
ralloc_free(cache);
|
||||
|
|
|
@ -249,6 +249,12 @@ path_fail:
|
|||
|
||||
return mapped;
|
||||
}
|
||||
|
||||
void
|
||||
disk_cache_destroy_mmap(struct disk_cache *cache)
|
||||
{
|
||||
munmap(cache->index_mmap, cache->index_mmap_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ENABLE_SHADER_CACHE */
|
||||
|
|
|
@ -83,6 +83,9 @@ bool
|
|||
disk_cache_mmap_cache_index(void *mem_ctx, struct disk_cache *cache,
|
||||
char *path);
|
||||
|
||||
void
|
||||
disk_cache_destroy_mmap(struct disk_cache *cache);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* DISK_CACHE_OS_H */
|
||||
|
|
Loading…
Reference in New Issue