diff options
| author | Markus Mittendrein <git@maxmitti.tk> | 2019-04-20 00:51:58 +0200 |
|---|---|---|
| committer | Markus Mittendrein <git@maxmitti.tk> | 2019-04-20 02:33:20 +0200 |
| commit | 712a61956cdd0e2e2907fb730b6dde9b5cc3524a (patch) | |
| tree | faa28cbe93f4b7caf3da87670267d8fd0af43700 /src/cc4group.h | |
| parent | 21a42510413d551d23a6aac8016b00d99214c3d6 (diff) | |
| download | cc4group-712a61956cdd0e2e2907fb730b6dde9b5cc3524a.tar.gz cc4group-712a61956cdd0e2e2907fb730b6dde9b5cc3524a.zip | |
Add a custom arg to memory management strategies
Diffstat (limited to 'src/cc4group.h')
| -rw-r--r-- | src/cc4group.h | 6 |
1 files changed, 4 insertions, 2 deletions
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; |
