(sieve_malloc,sieve_mstrdup,sieve_mrealloc,sieve_mfree): New functions.
Showing
2 changed files
with
29 additions
and
0 deletions
... | @@ -117,6 +117,11 @@ void *sieve_prealloc __P((list_t *pool, void *ptr, size_t size)); | ... | @@ -117,6 +117,11 @@ void *sieve_prealloc __P((list_t *pool, void *ptr, size_t size)); |
117 | void sieve_pfree __P((list_t *pool, void *ptr)); | 117 | void sieve_pfree __P((list_t *pool, void *ptr)); |
118 | char *sieve_pstrdup __P((list_t *pool, const char *str)); | 118 | char *sieve_pstrdup __P((list_t *pool, const char *str)); |
119 | 119 | ||
120 | void *sieve_malloc __P((sieve_machine_t mach, size_t size)); | ||
121 | char *sieve_mstrdup __P((sieve_machine_t mach, const char *str)); | ||
122 | void *sieve_mrealloc __P((sieve_machine_t mach, void *ptr, size_t size)); | ||
123 | void sieve_mfree __P((sieve_machine_t mach, void *ptr)); | ||
124 | |||
120 | sieve_value_t *sieve_value_create __P((sieve_data_type type, void *data)); | 125 | sieve_value_t *sieve_value_create __P((sieve_data_type type, void *data)); |
121 | void sieve_slist_destroy __P((list_t *plist)); | 126 | void sieve_slist_destroy __P((list_t *plist)); |
122 | 127 | ... | ... |
... | @@ -100,6 +100,30 @@ sieve_pfree (list_t *pool, void *ptr) | ... | @@ -100,6 +100,30 @@ sieve_pfree (list_t *pool, void *ptr) |
100 | free (ptr); | 100 | free (ptr); |
101 | } | 101 | } |
102 | 102 | ||
103 | void * | ||
104 | sieve_malloc (sieve_machine_t mach, size_t size) | ||
105 | { | ||
106 | return sieve_palloc (&mach->memory_pool, size); | ||
107 | } | ||
108 | |||
109 | char * | ||
110 | sieve_mstrdup (sieve_machine_t mach, const char *str) | ||
111 | { | ||
112 | return sieve_pstrdup (&mach->memory_pool, str); | ||
113 | } | ||
114 | |||
115 | void * | ||
116 | sieve_mrealloc (sieve_machine_t mach, void *ptr, size_t size) | ||
117 | { | ||
118 | return sieve_prealloc (&mach->memory_pool, ptr, size); | ||
119 | } | ||
120 | |||
121 | void | ||
122 | sieve_mfree (sieve_machine_t mach, void *ptr) | ||
123 | { | ||
124 | sieve_pfree (&mach->memory_pool, ptr); | ||
125 | } | ||
126 | |||
103 | static int | 127 | static int |
104 | _destroy_item (void *item, void *data) | 128 | _destroy_item (void *item, void *data) |
105 | { | 129 | { | ... | ... |
-
Please register or sign in to post a comment