| /external/volley/core/src/test/java/com/android/volley/toolbox/ |
| D | DiskBasedCacheTest.java | 5 * you may not use this file except in compliance with the License. 8 * http://www.apache.org/licenses/LICENSE-2.0 35 import com.android.volley.Cache; 42 import java.io.File; 67 private Cache cache; field in DiskBasedCacheTest 75 // Initialize empty cache in setup() 76 cache = new DiskBasedCache(temporaryFolder.getRoot(), MAX_SIZE); in setup() 77 cache.initialize(); in setup() 82 cache = null; in teardown() 87 assertThat(cache.get("key"), is(nullValue())); in testEmptyInitialize() [all …]
|
| /external/volley/core/src/main/java/com/android/volley/toolbox/ |
| D | DiskBasedCache.java | 5 * you may not use this file except in compliance with the License. 8 * http://www.apache.org/licenses/LICENSE-2.0 22 import com.android.volley.Cache; 29 import java.io.File; 45 * Cache implementation that caches files directly onto the hard disk in the specified directory. 48 * <p>This cache supports the {@link Entry#allResponseHeaders} headers field. 50 public class DiskBasedCache implements Cache { 55 /** Total amount of space currently used by the cache in bytes. */ 58 /** The supplier for the root directory to use for the cache. */ 61 /** The maximum size of the cache in bytes. */ [all …]
|
| /external/glide/third_party/disklrucache/src/main/java/com/bumptech/glide/disklrucache/ |
| D | DiskLruCache.java | 5 * you may not use this file except in compliance with the License. 8 * http://www.apache.org/licenses/LICENSE-2.0 22 import java.io.File; 42 * A cache that uses a bounded amount of space on a filesystem. Each cache 43 * entry has a string key and a fixed number of values. Each key must match 44 * the regex <strong>[a-z0-9_-]{1,120}</strong>. Values are byte sequences, 48 * <p>The cache stores its data in a directory on the filesystem. This 49 * directory must be exclusive to the cache; the cache may delete or overwrite 51 * same cache directory at the same time. 53 * <p>This cache limits the number of bytes that it will store on the [all …]
|
| /external/squashfs-tools/kernel/fs/squashfs/ |
| D | cache.c | 2 * Squashfs - a compressed read only filesystem for Linux 19 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 * cache.c 28 * This file implements a generic cache implementation used for both caches, 29 * plus functions layered ontop of the generic cache implementation to 32 * To avoid out of memory and fragmentation isssues with vmalloc the cache 35 * It should be noted that the cache is not used for file datablocks, these 36 * are decompressed and cached in the page-cache in the normal way. The 37 * cache is only used to temporarily cache fragment and metadata blocks 42 * have been packed with it, these because of locality-of-reference may be read [all …]
|
| /external/python/cpython3/Lib/ |
| D | linecache.py | 1 """Cache lines from Python source files. 3 This is intended to read lines from modules imported -- hence if a filename 4 is not found, it will look down the module search path for a file by 16 # The cache. Maps filenames to either a thunk which will provide source code, 18 cache = {} variable 22 """Clear the cache entirely.""" 23 cache.clear() 27 """Get a line for a Python source file from the cache. 28 Update the cache if it doesn't contain an entry for this file already.""" 32 return lines[lineno - 1] [all …]
|
| /external/squashfs-tools/squashfs-tools/ |
| D | unsquashfs.c | 21 * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 47 struct cache *fragment_cache, *data_cache; 53 int processors = -1; 141 if(ioctl(1, TIOCGWINSZ, &winsize) == -1) { in sigwinch_handler() 159 return (INT_MAX - a) < b; in add_overflow() 186 queue->data = malloc(sizeof(void *) * (size + 1)); in queue_init() 187 if(queue->data == NULL) in queue_init() 190 queue->size = size + 1; in queue_init() 191 queue->readp = queue->writep = 0; in queue_init() 192 pthread_mutex_init(&queue->mutex, NULL); in queue_init() [all …]
|
| /external/okhttp/okhttp/src/main/java/com/squareup/okhttp/internal/ |
| D | DiskLruCache.java | 5 * you may not use this file except in compliance with the License. 8 * http://www.apache.org/licenses/LICENSE-2.0 22 import java.io.File; 45 * A cache that uses a bounded amount of space on a filesystem. Each cache 46 * entry has a string key and a fixed number of values. Each key must match 47 * the regex <strong>[a-z0-9_-]{1,64}</strong>. Values are byte sequences, 51 * <p>The cache stores its data in a directory on the filesystem. This 52 * directory must be exclusive to the cache; the cache may delete or overwrite 54 * same cache directory at the same time. 56 * <p>This cache limits the number of bytes that it will store on the [all …]
|
| /external/cronet/net/disk_cache/blockfile/ |
| D | disk_format.h | 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 5 // The cache is stored on disk as a collection of block-files, plus an index 6 // file plus a collection of external files. 9 // a separate file named f_xxx where x is a hexadecimal number. Shorter data 10 // will be stored as a series of blocks on a block-file. In any case, CacheAddr 11 // represents the address of the data inside the cache. 13 // The index file is just a simple hash table that maps a particular entry to 15 // by the cache entry. 17 // The last element of the cache is the block-file. A block file is a file [all …]
|
| D | backend_impl.h | 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 5 // See net/disk_cache/disk_cache.h for the public interface of the cache. 53 // class handles the operations of the cache for a particular profile. 75 // Performs general initialization for this current instance of the cache. 84 int SyncOpenEntry(const std::string& key, scoped_refptr<EntryImpl>* entry); 85 int SyncCreateEntry(const std::string& key, scoped_refptr<EntryImpl>* entry); 100 // Open or create an entry for the given |key| or |iter|. 108 // Returns the full name for an external storage file. 111 // Returns the actual file used to store a given (non-external) address. [all …]
|
| /external/iproute2/lib/ |
| D | rt_names.c | 37 static int fread_id_name(FILE *fp, int *id, char *namebuf) in fread_id_name() 55 return -1; in fread_id_name() 63 rtnl_hash_initialize(const char *file, struct rtnl_hash_entry **hash, int size) in rtnl_hash_initialize() argument 65 struct rtnl_hash_entry *entry; in rtnl_hash_initialize() local 66 FILE *fp; in rtnl_hash_initialize() 71 fp = fopen(file, "r"); in rtnl_hash_initialize() 76 if (ret == -1) { in rtnl_hash_initialize() 78 file, namebuf); in rtnl_hash_initialize() 86 entry = malloc(sizeof(*entry)); in rtnl_hash_initialize() 87 entry->id = id; in rtnl_hash_initialize() [all …]
|
| /external/okhttp/repackaged/okhttp/src/main/java/com/android/okhttp/internal/ |
| D | DiskLruCache.java | 6 * you may not use this file except in compliance with the License. 9 * http://www.apache.org/licenses/LICENSE-2.0 23 import java.io.File; 46 * A cache that uses a bounded amount of space on a filesystem. Each cache 47 * entry has a string key and a fixed number of values. Each key must match 48 * the regex <strong>[a-z0-9_-]{1,64}</strong>. Values are byte sequences, 52 * <p>The cache stores its data in a directory on the filesystem. This 53 * directory must be exclusive to the cache; the cache may delete or overwrite 55 * same cache directory at the same time. 57 * <p>This cache limits the number of bytes that it will store on the [all …]
|
| /external/mtools/ |
| D | vfat.c | 2 * Copyright 1996-2003,2005,2007-2009 Alain Knaff. 3 * This file is part of mtools. 20 * Miscellaneous VFAT-related functions 27 #include "file.h" 50 tildapos = -1; in autorename() 66 seqnum = seqnum * 10 + (uint8_t)(name[dotpos] - '0'); in autorename() 69 tildapos = -1; /* sequence number interrupted */ in autorename() 71 if(tildapos == -1) { in autorename() 73 if(dotpos > limit - 2) { in autorename() 74 tildapos = limit - 2; in autorename() [all …]
|
| D | dirCache.c | 1 /* Copyright 1998,2001-2003,2007-2009 Alain Knaff. 2 * This file is part of mtools. 30 return (arg << shift) | (arg >> (32 - shift)); in rol() 67 int entry; in addBit() local 70 entry = (hash / BITS_PER_INT) % DC_BITMAP_SIZE; in addBit() 73 return bitmap[entry] & bit; in addBit() 75 bitmap[entry] |= bit; in addBit() 80 static int _addHash(dirCache_t *cache, unsigned int hash, int checkOnly) in _addHash() argument 83 addBit(cache->bm0, hash, checkOnly) && in _addHash() 84 addBit(cache->bm1, rol(hash,12), checkOnly) && in _addHash() [all …]
|
| /external/aws-sdk-java-v2/utils/src/main/java/software/amazon/awssdk/utils/cache/lru/ |
| D | LruCache.java | 5 * You may not use this file except in compliance with the License. 10 * or in the "license" file accompanying this file. This file is distributed 16 package software.amazon.awssdk.utils.cache.lru; 28 …* A thread-safe LRU (Least Recently Used) cache implementation that returns the value for a specif… 29 …* retrieving it by either getting the stored value from the cache or using a supplied function to … 30 * and add it to the cache. 32 * When the cache is full, a new value will push out the least recently used value. 33 …* When the cache is queried for an already stored value (cache hit), this value is moved to the ba… 36 * The user can configure the maximum size of the cache, which is set to a default of 100. 48 private final Map<K, CacheEntry<K, V>> cache; field in LruCache [all …]
|
| /external/cronet/net/disk_cache/ |
| D | disk_cache.h | 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 5 // Defines the public interface of the disk cache. For more details see 6 // http://dev.chromium.org/developers/design-documents/network-stack/disk-cache 17 #include "base/files/file.h" 28 #include "third_party/abseil-cpp/absl/types/optional.h" 46 class Entry; variable 54 // How to handle resetting the back-end cache from the previous session. 79 // (nullable) is used to broker file operations in sandboxed environments. 82 // appropriate). This cache instance must be the only object that will be [all …]
|
| D | backend_unittest.cc | 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 10 #include "base/files/file.h" 64 #include "third_party/abseil-cpp/absl/types/optional.h" 80 // TODO(crbug.com/949811): Fix memory leaks in tests and re-enable on LSAN. 97 const char kExistingEntryKey[] = "existing entry key"; 103 std::unique_ptr<disk_cache::BackendImpl> cache( in CreateExistingEntryCache() local 109 cache->Init(cb.callback()); in CreateExistingEntryCache() 115 cache->CreateEntry(kExistingEntryKey, net::HIGHEST, cb2.callback()); in CreateExistingEntryCache() 120 return cache; in CreateExistingEntryCache() [all …]
|
| /external/cronet/components/nacl/browser/ |
| D | pnacl_host.cc | 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 31 // Delay to wait for initialization of the cache backend 34 void CloseBaseFile(base::File file) { in CloseBaseFile() argument 38 base::DoNothingWithBoundArgs(std::move(file))); in CloseBaseFile() 47 FileProxy(std::unique_ptr<base::File> file, PnaclHost* host); 52 std::unique_ptr<base::File> file_; 56 FileProxy::FileProxy(std::unique_ptr<base::File> file, PnaclHost* host) in FileProxy() argument 57 : file_(std::move(file)), host_(host) {} in FileProxy() 60 int rv = file_->Write(0, buffer->data(), buffer->size()); in Write() [all …]
|
| /external/strace/ |
| D | mmap_cache.c | 3 * Copyright (c) 2013-2018 The strace developers. 42 if (tcp->currpers != DEFAULT_PERSONALITY) { in mmap_cache_invalidate() 48 debug_func_msg("tgen=%u, ggen=%u, tcp=%p, cache=%p", in mmap_cache_invalidate() 49 tcp->mmap_cache ? tcp->mmap_cache->generation : 0, in mmap_cache_invalidate() 51 tcp->mmap_cache ? tcp->mmap_cache->entry : 0); in mmap_cache_invalidate() 65 /* deleting the cache */ 69 debug_func_msg("tgen=%u, ggen=%u, tcp=%p, cache=%p, caller=%s", in delete_mmap_cache() 70 tcp->mmap_cache ? tcp->mmap_cache->generation : 0, in delete_mmap_cache() 72 tcp->mmap_cache ? tcp->mmap_cache->entry : 0, caller); in delete_mmap_cache() 74 if (!tcp->mmap_cache) in delete_mmap_cache() [all …]
|
| /external/grpc-grpc-java/rls/src/test/java/io/grpc/rls/ |
| D | LinkedHashLruCacheTest.java | 5 * you may not use this file except in compliance with the License. 8 * http://www.apache.org/licenses/LICENSE-2.0 51 private EvictionListener<Integer, Entry> evictionListener; 52 private LinkedHashLruCache<Integer, Entry> cache; field in LinkedHashLruCacheTest 56 this.cache = new LinkedHashLruCache<Integer, Entry>( in setUp() 65 protected boolean isExpired(Integer key, Entry value, long nowNanos) { in setUp() 70 protected int estimateSizeOf(Integer key, Entry value) { in setUp() 79 cache.cache(i, new Entry("Entry" + i, Long.MAX_VALUE)); in eviction_size() 81 cache.cache(MAX_SIZE + 1, new Entry("should kick the first", Long.MAX_VALUE)); in eviction_size() 83 verify(evictionListener).onEviction(1, new Entry("Entry1", Long.MAX_VALUE), EvictionType.SIZE); in eviction_size() [all …]
|
| /external/elfutils/libdw/ |
| D | fde.c | 2 Copyright (C) 2009-2010, 2014, 2015 Red Hat, Inc. 3 This file is part of elfutils. 5 This file is free software; you can redistribute it and/or modify 37 #include "encoded-value.h" 47 if (fde1->end == 0) in compare_fde() 49 if (fde1->start < fde2->start) in compare_fde() 50 return -1; in compare_fde() 51 if (fde1->start >= fde2->end) in compare_fde() 56 if (fde2->start < fde1->start) in compare_fde() 58 if (fde2->start >= fde1->end) in compare_fde() [all …]
|
| /external/mesa3d/src/util/tests/ |
| D | cache_test.cpp | 24 /* A collection of unit tests for cache.c */ 41 #include "util/mesa-sha1.h" 66 * This is equivalent to "rm -rf <dir>" with one bit of protection 70 * Returns 0 on success, -1 on any error. 76 return -1; in rmrf_local() 90 if (stat(full_path, &sb) != -1 && S_ISDIR(sb.st_mode)) in check_directories_created() 98 does_cache_contain(struct disk_cache *cache, const cache_key key) in does_cache_contain() argument 102 result = disk_cache_get(cache, key, NULL); in does_cache_contain() 113 cache_exists(struct disk_cache *cache) in cache_exists() argument 118 if (!cache) in cache_exists() [all …]
|
| /external/mesa3d/src/gallium/auxiliary/util/ |
| D | u_cache.c | 20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 29 * @file 30 * Improved cache implementation. 74 /** Max entries in the cache */ 80 /** Number of entries in the cache */ 83 /** Head of list, sorted from Least-recently used to Most-recently used */ 89 ensure_sanity(const struct util_cache *cache); 94 * Create a new cache with 'size' entries. Also provide functions for 103 struct util_cache *cache; in util_cache_create() local 105 cache = CALLOC_STRUCT(util_cache); in util_cache_create() [all …]
|
| /external/mesa3d/src/util/ |
| D | mesa_cache_db.c | 7 * SPDX-License-Identifier: MIT 18 #include <sys/file.h> 24 #include "mesa-sha1.h" 61 static inline bool mesa_db_seek_end(FILE *file) in mesa_db_seek_end() argument 63 return !fseek(file, 0, SEEK_END); in mesa_db_seek_end() 66 static inline bool mesa_db_seek(FILE *file, long pos) in mesa_db_seek() argument 68 return !fseek(file, pos, SEEK_SET); in mesa_db_seek() 71 static inline bool mesa_db_seek_cur(FILE *file, long pos) in mesa_db_seek_cur() argument 73 return !fseek(file, pos, SEEK_CUR); in mesa_db_seek_cur() 76 static inline bool mesa_db_read_data(FILE *file, void *data, size_t size) in mesa_db_read_data() argument [all …]
|
| /external/openthread/third_party/mbedtls/repo/include/mbedtls/ |
| D | ssl_cache.h | 2 * \file ssl_cache.h 4 * \brief SSL session cache implementation 8 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 38 #define MBEDTLS_SSL_CACHE_DEFAULT_MAX_ENTRIES 50 /*!< Maximum entries in cache */ 51 * \brief This structure is used for storing cache entries 55 mbedtls_time_t timestamp; /*!< entry timestamp */ 57 mbedtls_ssl_session session; /*!< entry session */ 60 mbedtls_x509_buf peer_cert; /*!< entry peer_cert */ 66 * \brief Cache context 70 int timeout; /*!< cache entry timeout */ [all …]
|
| /external/okhttp/okhttp/src/main/java/com/squareup/okhttp/ |
| D | Cache.java | 5 * you may not use this file except in compliance with the License. 8 * http://www.apache.org/licenses/LICENSE-2.0 28 import java.io.File; 53 * <h3>Cache Optimization</h3> 54 * To measure cache effectiveness, this class tracks three statistics: 57 * requests issued since this cache was created. 61 * responses were served by the cache. 64 * Sometimes a request will result in a conditional cache hit. If the cache contains a stale copy of 69 * <p>The best way to improve the cache hit rate is by configuring the web server to return 71 * href="http://tools.ietf.org/html/rfc7234">HTTP/1.1 (RFC 7234)</a> cache headers, it doesn't cache [all …]
|