1 #ifndef _PSI_TYPES_FREE_CALLS_H
2 #define _PSI_TYPES_FREE_CALLS_H
4 typedef struct free_calls
{
9 static inline free_calls
*init_free_calls(free_call
*f
) {
10 free_calls
*fcs
= calloc(1, sizeof(*fcs
));
13 fcs
->list
= calloc(1, sizeof(*fcs
->list
));
19 static inline void free_free_calls(free_calls
*fcs
) {
22 for (i
= 0; i
< fcs
->count
; ++i
) {
23 free_free_call(fcs
->list
[i
]);
29 static inline free_calls
*add_free_call(free_calls
*fcs
, free_call
*f
) {
30 fcs
->list
= realloc(fcs
->list
, ++fcs
->count
* sizeof(*fcs
->list
));
31 fcs
->list
[fcs
->count
-1] = f
;