Lines Matching +full:non +full:- +full:free
4 * Permission is hereby granted, free of charge, to any person obtaining a
42 #include "util/mesa-sha1.h"
71 * This is equivalent to "rm -rf <dir>" with one bit of protection
75 * Returns 0 on success, -1 on any error.
81 return -1; in rmrf_local()
95 if (stat(full_path, &sb) != -1 && S_ISDIR(sb.st_mode)) in check_directories_created()
110 free(result); in does_cache_contain()
132 free(result); in cache_exists()
158 if (len == -1) { in close_and_wait_for_list()
167 i += sizeof(struct inotify_event) + event->len; in close_and_wait_for_list()
168 if (event->mask & IN_CLOSE_NOWRITE) in close_and_wait_for_list()
177 #define CACHE_TEST_TMP "./cache-test-tmp"
187 * MESA_SHADER_CACHE_DISABLE set to true, that disk_cache_create returns NO-OP cache. in test_disk_cache_create()
191 … EXPECT_EQ(cache->type, DISK_CACHE_NONE) << "disk_cache_create with MESA_SHADER_CACHE_DISABLE set"; in test_disk_cache_create()
198 * MESA_SHADER_CACHE_DISABLE set to nothing, disk_cache_create returns NO-OP cache. in test_disk_cache_create()
202 EXPECT_EQ(cache->type, DISK_CACHE_NONE) in test_disk_cache_create()
230 setenv("XDG_CACHE_HOME", CACHE_TEST_TMP "/xdg-cache-home", 1); in test_disk_cache_create()
233 << "disk_cache_create with XDG_CACHE_HOME set with a non-existing parent directory"; in test_disk_cache_create()
236 mem_ctx, "%s%s", CACHE_TEST_TMP "/xdg-cache-home/", cache_dir_name); in test_disk_cache_create()
245 setenv("MESA_SHADER_CACHE_DIR", CACHE_TEST_TMP "/mesa-shader-cache-dir", 1); in test_disk_cache_create()
248 << "disk_cache_create with MESA_SHADER_CACHE_DIR set with a non-existing parent directory"; in test_disk_cache_create()
264 mem_ctx, "%s%s", CACHE_TEST_TMP "/mesa-shader-cache-dir/", cache_dir_name); in test_disk_cache_create()
274 char blob[] = "This is a blob of thirty-seven bytes"; in test_put_and_get()
276 char string[] = "While this string has thirty-four"; in test_put_and_get()
294 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in test_put_and_get()
295 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in test_put_and_get()
307 free(result); in test_put_and_get()
320 free(result); in test_put_and_get()
333 /* Obviously the SHA-1 hash of 1024 zero bytes isn't particularly in test_put_and_get()
355 free(one_KB); in test_put_and_get()
364 free(result); in test_put_and_get()
420 free(one_MB); in test_put_and_get()
491 /* And finally test that we can re-add the original key to re-evict in test_put_key_and_get_key()
511 char blob[] = "This is a blob of thirty-seven bytes"; in test_put_and_get_between_instances()
513 char string[] = "While this string has thirty-four"; in test_put_and_get_between_instances()
531 EXPECT_EQ(result, nullptr) << "disk_cache_get(cache1) with non-existent item (pointer)"; in test_put_and_get_between_instances()
532 EXPECT_EQ(size, 0) << "disk_cache_get(cach1) with non-existent item (size)"; in test_put_and_get_between_instances()
535 EXPECT_EQ(result, nullptr) << "disk_cache_get(cache2) with non-existent item (pointer)"; in test_put_and_get_between_instances()
536 EXPECT_EQ(size, 0) << "disk_cache_get(cache2) with non-existent item (size)"; in test_put_and_get_between_instances()
548 free(result); in test_put_and_get_between_instances()
561 free(result); in test_put_and_get_between_instances()
595 size_big -= sizeof(struct cache_entry_file_data); in test_put_and_get_between_instances_with_eviction()
596 size_big -= mesa_cache_db_file_entry_size(); in test_put_and_get_between_instances_with_eviction()
597 size_big -= cache[0]->driver_keys_blob_size; in test_put_and_get_between_instances_with_eviction()
598 size_big -= 4 + 8; /* cache_item_metadata size + room for alignment */ in test_put_and_get_between_instances_with_eviction()
611 free(result); in test_put_and_get_between_instances_with_eviction()
613 free(big); in test_put_and_get_between_instances_with_eviction()
617 size_small -= sizeof(struct cache_entry_file_data); in test_put_and_get_between_instances_with_eviction()
618 size_small -= mesa_cache_db_file_entry_size(); in test_put_and_get_between_instances_with_eviction()
619 size_small -= cache[1]->driver_keys_blob_size; in test_put_and_get_between_instances_with_eviction()
620 size_small -= 4 + 8; /* cache_item_metadata size + room for alignment */ in test_put_and_get_between_instances_with_eviction()
640 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in test_put_and_get_between_instances_with_eviction()
641 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in test_put_and_get_between_instances_with_eviction()
642 free(result); in test_put_and_get_between_instances_with_eviction()
645 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in test_put_and_get_between_instances_with_eviction()
646 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in test_put_and_get_between_instances_with_eviction()
647 free(result); in test_put_and_get_between_instances_with_eviction()
652 free(result); in test_put_and_get_between_instances_with_eviction()
657 free(result); in test_put_and_get_between_instances_with_eviction()
661 free(small); in test_put_and_get_between_instances_with_eviction()
673 free(small); in test_put_and_get_between_instances_with_eviction()
679 free(result); in test_put_and_get_between_instances_with_eviction()
687 free(result); in test_put_and_get_between_instances_with_eviction()
691 EXPECT_EQ(i, 10) << "2x disk_cache_get with 5 non-existent 256KB items"; in test_put_and_get_between_instances_with_eviction()
722 free(result); in test_put_big_sized_entry_to_empty_cache()
827 * data much better than the multi-file cache, which results in the in TEST_F()
880 /* Enable Fossilize read-write cache. */ in TEST_F()
894 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in TEST_F()
895 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in TEST_F()
904 free(result); in TEST_F()
906 /* Rename file foz_cache.foz -> ro_cache.foz */ in TEST_F()
907 sprintf(foz_rw_file, "%s/foz_cache.foz", cache_sf_wr->path); in TEST_F()
908 sprintf(foz_ro_file, "%s/ro_cache.foz", cache_sf_wr->path); in TEST_F()
911 /* Rename file foz_cache_idx.foz -> ro_cache_idx.foz */ in TEST_F()
912 sprintf(foz_rw_idx_file, "%s/foz_cache_idx.foz", cache_sf_wr->path); in TEST_F()
913 sprintf(foz_ro_idx_file, "%s/ro_cache_idx.foz", cache_sf_wr->path); in TEST_F()
918 /* Disable Fossilize read-write cache. */ in TEST_F()
921 /* Set up Fossilize read-only cache. */ in TEST_F()
935 free(result); in TEST_F()
946 /* Create MESA-DB cache with enabled retrieval from the read-only in TEST_F()
952 * reloads index if cache entry is missing. This is a sanity-check in TEST_F()
956 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in TEST_F()
957 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in TEST_F()
960 * read-only cache. */ in TEST_F()
964 free(result); in TEST_F()
968 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in TEST_F()
969 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in TEST_F()
976 * read-write cache. */ in TEST_F()
980 free(result); in TEST_F()
984 /* Disable read-only cache. */ in TEST_F()
987 /* Create MESA-DB cache with disabled retrieval from the in TEST_F()
988 * read-only cache. */ in TEST_F()
992 * MESA-DB cache. */ in TEST_F()
996 free(result); in TEST_F()
1000 /* Create MESA-DB cache with disabled retrieval from the read-only in TEST_F()
1005 * read-only cache. */ in TEST_F()
1007 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in TEST_F()
1008 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in TEST_F()
1012 /* Create default multi-file cache. */ in TEST_F()
1015 /* Enable read-only cache. */ in TEST_F()
1018 /* Create multi-file cache with enabled retrieval from the in TEST_F()
1019 * read-only cache. */ in TEST_F()
1024 * read-only cache. */ in TEST_F()
1028 free(result); in TEST_F()
1032 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in TEST_F()
1033 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in TEST_F()
1040 * read-write cache. */ in TEST_F()
1044 free(result); in TEST_F()
1048 /* Disable read-only cache. */ in TEST_F()
1052 /* Create multi-file cache with disabled retrieval from the in TEST_F()
1053 * read-only cache. */ in TEST_F()
1057 * read-only cache. */ in TEST_F()
1059 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in TEST_F()
1060 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in TEST_F()
1063 * read-write cache. */ in TEST_F()
1067 free(result); in TEST_F()
1114 << "disk_cache_get with non-existent item (pointer)"; in TEST_F()
1115 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in TEST_F()
1124 free(result); in TEST_F()
1126 /* Rename file foz_cache.foz -> ro_cache.foz */ in TEST_F()
1127 sprintf(foz_rw_file, "%s/foz_cache.foz", cache_sf_wr->path); in TEST_F()
1128 sprintf(foz_ro_file, "%s/ro_cache.foz", cache_sf_wr->path); in TEST_F()
1132 /* Rename file foz_cache_idx.foz -> ro_cache_idx.foz */ in TEST_F()
1133 sprintf(foz_rw_idx_file, "%s/foz_cache_idx.foz", cache_sf_wr->path); in TEST_F()
1134 sprintf(foz_ro_idx_file, "%s/ro_cache_idx.foz", cache_sf_wr->path); in TEST_F()
1156 free(result); in TEST_F()
1172 << "disk_cache_get with non-existent item (pointer)"; in TEST_F()
1173 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in TEST_F()
1189 free(result); in TEST_F()
1205 << "disk_cache_get with non-existent item (pointer)"; in TEST_F()
1206 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in TEST_F()
1208 /* Add non-existant list files for loading */ in TEST_F()
1227 free(result); in TEST_F()
1257 entry_file_size -= sizeof(struct cache_entry_file_data); in test_multipart_eviction()
1258 entry_file_size -= mesa_cache_db_file_entry_size(); in test_multipart_eviction()
1259 entry_file_size -= cache->driver_keys_blob_size; in test_multipart_eviction()
1260 entry_file_size -= 4 + 8; /* cache_item_metadata size + room for alignment */ in test_multipart_eviction()
1283 free(result); in test_multipart_eviction()
1297 free(result); in test_multipart_eviction()
1310 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in test_multipart_eviction()
1315 free(result); in test_multipart_eviction()
1345 char blob[] = "This is a blob of thirty-seven bytes"; in test_put_and_get_disabled()
1356 EXPECT_EQ(result, nullptr) << "disk_cache_get with non-existent item (pointer)"; in test_put_and_get_disabled()
1357 EXPECT_EQ(size, 0) << "disk_cache_get with non-existent item (size)"; in test_put_and_get_disabled()