mmap-cache: add MMapCache trivial cleanup helpers
authorVito Caputo <vcaputo@pengaru.com>
Tue, 7 Dec 2021 22:16:28 +0000 (14:16 -0800)
committerVito Caputo <vcaputo@pengaru.com>
Tue, 7 Dec 2021 22:16:28 +0000 (14:16 -0800)
Enable _cleanup_(mmap_cache_unrefp) style cleanup for MMapCache*

src/libsystemd/sd-journal/mmap-cache.h

index 907ebae843b6307399420d20224bb2af69306570..4769414ded32bbc57f57c023b401cf3ef6b4669d 100644 (file)
@@ -13,6 +13,7 @@ typedef struct MMapFileDescriptor MMapFileDescriptor;
 MMapCache* mmap_cache_new(void);
 MMapCache* mmap_cache_ref(MMapCache *m);
 MMapCache* mmap_cache_unref(MMapCache *m);
+DEFINE_TRIVIAL_CLEANUP_FUNC(MMapCache*, mmap_cache_unref);
 
 int mmap_cache_fd_get(
         MMapFileDescriptor *f,