1 /* SPDX-License-Identifier: LGPL-2.1+ */
7 /* One context per object type, plus one of the header, plus one "additional" one */
8 #define MMAP_CACHE_MAX_CONTEXTS 9
10 typedef struct MMapCache MMapCache
;
11 typedef struct MMapFileDescriptor MMapFileDescriptor
;
13 MMapCache
* mmap_cache_new(void);
14 MMapCache
* mmap_cache_ref(MMapCache
*m
);
15 MMapCache
* mmap_cache_unref(MMapCache
*m
);
19 MMapFileDescriptor
*f
,
28 MMapFileDescriptor
* mmap_cache_add_fd(MMapCache
*m
, int fd
);
29 void mmap_cache_free_fd(MMapCache
*m
, MMapFileDescriptor
*f
);
31 unsigned mmap_cache_get_hit(MMapCache
*m
);
32 unsigned mmap_cache_get_missed(MMapCache
*m
);
34 bool mmap_cache_got_sigbus(MMapCache
*m
, MMapFileDescriptor
*f
);