Skip to content

Commit edc387f

Browse files
committed
fixup! fscache: teach fscache to use mempool
Needed for the recent mem-pool changes. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 29be755 commit edc387f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

compat/win32/fscache.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ CRITICAL_SECTION fscache_cs;
1919
struct fscache {
2020
volatile long enabled;
2121
struct hashmap map;
22-
struct mem_pool *mem_pool;
22+
struct mem_pool mem_pool;
2323
unsigned int lstat_requests;
2424
unsigned int opendir_requests;
2525
unsigned int fscache_requests;
@@ -132,7 +132,7 @@ static struct fsentry *fsentry_alloc(struct fscache *cache, struct fsentry *list
132132
{
133133
/* overallocate fsentry and copy the name to the end */
134134
struct fsentry *fse =
135-
mem_pool_alloc(cache->mem_pool, sizeof(*fse) + len + 1);
135+
mem_pool_alloc(&cache->mem_pool, sizeof(*fse) + len + 1);
136136
/* init the rest of the structure */
137137
fsentry_init(fse, list, name, len);
138138
fse->next = NULL;
@@ -355,8 +355,7 @@ static void fscache_add(struct fscache *cache, struct fsentry *fse)
355355
*/
356356
static void fscache_clear(struct fscache *cache)
357357
{
358-
mem_pool_discard(cache->mem_pool, 0);
359-
cache->mem_pool = NULL;
358+
mem_pool_discard(&cache->mem_pool, 0);
360359
mem_pool_init(&cache->mem_pool, 0);
361360
hashmap_free(&cache->map);
362361
hashmap_init(&cache->map, (hashmap_cmp_fn)fsentry_cmp, NULL, 0);
@@ -534,7 +533,7 @@ void fscache_disable(void)
534533
"total requests/misses %u/%u\n",
535534
cache->lstat_requests, cache->opendir_requests,
536535
cache->fscache_requests, cache->fscache_misses);
537-
mem_pool_discard(cache->mem_pool, 0);
536+
mem_pool_discard(&cache->mem_pool, 0);
538537
hashmap_free(&cache->map);
539538
free(cache);
540539
}
@@ -766,7 +765,7 @@ void fscache_merge(struct fscache *dest)
766765
while ((e = hashmap_iter_next(&iter)))
767766
hashmap_add(&dest->map, e);
768767

769-
mem_pool_combine(dest->mem_pool, cache->mem_pool);
768+
mem_pool_combine(&dest->mem_pool, &cache->mem_pool);
770769

771770
dest->lstat_requests += cache->lstat_requests;
772771
dest->opendir_requests += cache->opendir_requests;

0 commit comments

Comments
 (0)