Node:Memory Allocation, Next:Compiling and Executing the Script, Previous:Symbol Space Functions, Up:Library Description
The following functions act as their libc counterparts. The allocated
memory is associated with the mach argument and is automatically
freed upon the call to sieve_machine_destroy (mach).
| void * sieve_malloc (sieve_machine_t mach, size_t size) | Function | 
| Allocates size bytes and returns a pointer to the allocated memory. | 
| char * sieve_mstrdup (sieve_machine_t mach, const char *str) | Function | 
| This function returns a pointer to a new string which is a duplicate of the string str. | 
| void * sieve_mrealloc (sieve_machine_t mach, void *ptr, size_t size) | Function | 
| Changes the size of the memory block pointed to by ptr to
size bytes.  The contents will be unchanged to the minimum of the
old and new sizes; newly allocated memory will be uninitialized. If
ptr is NULL, the call is equivalent tosieve_malloc(mach, size); if size is equal to
zero, the call is equivalent tosieve_mfree(ptr). Unless
ptr isNULL, it must have been returned by an earlier
call tosieve_malloc()orsieve_mrealloc(). | 
| void sieve_mfree (sieve_machine_t mach, void *ptr) | Function | 
| sieve_mfree()frees the memory space pointed to by ptr and
detaches it from the destructor list of mach. The ptr must
have been returned by a previous call tosieve_malloc()orsieve_mrealloc(). Otherwise, or ifsieve_mfree(ptr)has already been called before, undefined behaviour occurs.If ptr is  |