Memory management wrappers. More...
#include "config.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "memory.h"
#include "exit.h"
#include "logging2.h"
Go to the source code of this file.
Functions | |
void * | mutt_mem_calloc (size_t nmemb, size_t size) |
Allocate zeroed memory on the heap. | |
void | mutt_mem_free (void *ptr) |
Release memory allocated on the heap. | |
void * | mutt_mem_malloc (size_t size) |
Allocate memory on the heap. | |
void | mutt_mem_realloc (void *ptr, size_t size) |
Resize a block of memory on the heap. | |
Memory management wrappers.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file memory.c.
void * mutt_mem_calloc | ( | size_t | nmemb, |
size_t | size | ||
) |
Allocate zeroed memory on the heap.
nmemb | Number of blocks |
size | Size of blocks |
ptr | Memory on the heap |
The caller should call mutt_mem_free() to release the memory
Definition at line 51 of file memory.c.
void mutt_mem_free | ( | void * | ptr | ) |
void * mutt_mem_malloc | ( | size_t | size | ) |
Allocate memory on the heap.
size | Size of block to allocate |
ptr | Memory on the heap |
The caller should call mutt_mem_free() to release the memory
Definition at line 91 of file memory.c.
void mutt_mem_realloc | ( | void * | ptr, |
size_t | size | ||
) |
Resize a block of memory on the heap.
ptr | Memory block to resize |
size | New size |
If the new size is zero, the block will be freed.
Definition at line 115 of file memory.c.