Displaying 1 result from an estimated 1 matches for "max_cache_entries".
2009 May 24
0
malloc() in the core
...dle
multiple block sizes (first of all, because hard disks are going to be
changing from 512 to 4K sectors over the next several years, and second
because filesystems like ext2 have metadata which is more logically
cached on the filesystem block level):
static struct cache_struct cache_head, cache[MAX_CACHE_ENTRIES];
static uint8_t cache_data[65536];
static int cache_block_size;
static int cache_entries;
void cache_init(int block_size)
{
struct cache_struct *prev, *cur;
uint8_t *data = cache_data;
int i;
cache_block_size = block_size;
cache_entries = sizeof cache_data / block_size;
if (c...