APPFS
Advanced practical programming for scientists
|
Wrapper for malloc. More...
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include "allocate.h"
#include "mshell.h"
Go to the source code of this file.
Functions | |
void * | allocate (int elems, int size) |
Allocate memory. More... | |
void | deallocate (void *p) |
Free allocated memory. More... | |
Definition in file allocate.c.
void* allocate | ( | int | elems, |
int | size | ||
) |
If no memory is available the program will be terminated. The minimum allocation is 1 byte. Memory is initialized to zero, or false in case of bool.
elems | number of elements |
size | size of one element in bytes |
Definition at line 23 of file allocate.c.
void deallocate | ( | void * | p | ) |
Releases the previous allocated memory. It should only be used with memory that has been allocated by allocate .
p | Pointer to memory area that was previously returned by allocate |
Definition at line 47 of file allocate.c.