Commit 35ddbb9e 35ddbb9e11099e147af1598c0e94e075d53f2059 by Sergey Poznyakoff

(sieve_malloc,sieve_mstrdup,sieve_mrealloc,sieve_mfree): New functions.

1 parent 455cc0e5
......@@ -117,6 +117,11 @@ void *sieve_prealloc __P((list_t *pool, void *ptr, size_t size));
void sieve_pfree __P((list_t *pool, void *ptr));
char *sieve_pstrdup __P((list_t *pool, const char *str));
void *sieve_malloc __P((sieve_machine_t mach, size_t size));
char *sieve_mstrdup __P((sieve_machine_t mach, const char *str));
void *sieve_mrealloc __P((sieve_machine_t mach, void *ptr, size_t size));
void sieve_mfree __P((sieve_machine_t mach, void *ptr));
sieve_value_t *sieve_value_create __P((sieve_data_type type, void *data));
void sieve_slist_destroy __P((list_t *plist));
......
......@@ -100,6 +100,30 @@ sieve_pfree (list_t *pool, void *ptr)
free (ptr);
}
void *
sieve_malloc (sieve_machine_t mach, size_t size)
{
return sieve_palloc (&mach->memory_pool, size);
}
char *
sieve_mstrdup (sieve_machine_t mach, const char *str)
{
return sieve_pstrdup (&mach->memory_pool, str);
}
void *
sieve_mrealloc (sieve_machine_t mach, void *ptr, size_t size)
{
return sieve_prealloc (&mach->memory_pool, ptr, size);
}
void
sieve_mfree (sieve_machine_t mach, void *ptr)
{
sieve_pfree (&mach->memory_pool, ptr);
}
static int
_destroy_item (void *item, void *data)
{
......