From 712a61956cdd0e2e2907fb730b6dde9b5cc3524a Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Sat, 20 Apr 2019 00:51:58 +0200 Subject: Add a custom arg to memory management strategies --- src/cc4group.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/cc4group.h') diff --git a/src/cc4group.h b/src/cc4group.h index 0a3ceb4..780c50e 100644 --- a/src/cc4group.h +++ b/src/cc4group.h @@ -140,10 +140,12 @@ typedef void* (*CC4Group_TmpMemoryStrategy)(CC4Group* const this, const size_t s // actually, a memory management strategy is a pointer to an instance of this struct // it consists of a start function (like allocating some memory and making a copy) // and of an end function, which does the actual cleanup +// and an optional custom arg that will be passed to both functions // additionally to the predefined memory management strategies, custom strategies may be used typedef struct { - void* (*start)(void* const data, const size_t size); - void (*end)(void* const data); + void* (*start)(void* const data, const size_t size, void* const arg); + void (*end)(void* const data, void* const arg); + void* arg; } const CC4Group_MemoryManagement_t; typedef CC4Group_MemoryManagement_t* CC4Group_MemoryManagement; -- cgit v1.2.3-54-g00ecf