mmap-cache: add MMapFileDescriptor.cache accessor
Sometimes we want to reuse an existing MMapFileDescriptor's cache, but it's a private struct. This lets us access that pointer if necessary.
This commit is contained in:
@@ -591,3 +591,9 @@ void mmap_cache_fd_free(MMapFileDescriptor *f) {
|
||||
|
||||
free(f);
|
||||
}
|
||||
|
||||
MMapCache* mmap_cache_fd_cache(MMapFileDescriptor *f) {
|
||||
assert(f);
|
||||
|
||||
return f->cache;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ int mmap_cache_fd_get(
|
||||
size_t size,
|
||||
struct stat *st,
|
||||
void **ret);
|
||||
MMapFileDescriptor * mmap_cache_add_fd(MMapCache *m, int fd, int prot);
|
||||
MMapFileDescriptor* mmap_cache_add_fd(MMapCache *m, int fd, int prot);
|
||||
MMapCache* mmap_cache_fd_cache(MMapFileDescriptor *f);
|
||||
void mmap_cache_fd_free(MMapFileDescriptor *f);
|
||||
|
||||
void mmap_cache_stats_log_debug(MMapCache *m);
|
||||
|
||||
Reference in New Issue
Block a user