1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 Copyright 2012 Lennart Poettering
11 /* One context per object type, plus one of the header, plus one "additional" one */
12 #define MMAP_CACHE_MAX_CONTEXTS 9
14 typedef struct MMapCache MMapCache
;
15 typedef struct MMapFileDescriptor MMapFileDescriptor
;
17 MMapCache
* mmap_cache_new(void);
18 MMapCache
* mmap_cache_ref(MMapCache
*m
);
19 MMapCache
* mmap_cache_unref(MMapCache
*m
);
23 MMapFileDescriptor
*f
,
32 MMapFileDescriptor
* mmap_cache_add_fd(MMapCache
*m
, int fd
);
33 void mmap_cache_free_fd(MMapCache
*m
, MMapFileDescriptor
*f
);
35 unsigned mmap_cache_get_hit(MMapCache
*m
);
36 unsigned mmap_cache_get_missed(MMapCache
*m
);
38 bool mmap_cache_got_sigbus(MMapCache
*m
, MMapFileDescriptor
*f
);