forked from TstevetsT/ListMalloc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmalloc3140.h
33 lines (26 loc) · 1.24 KB
/
malloc3140.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef __MALLOC_3140_H
#define __MALLOC_3140_H
//allocate a block of memory capable of holding size
//bytes of user specified data. If size is zero, a pointer
//to zero bytes of memory should be returned
//returns NULL on failure or pointer to new block on success
void *l_malloc(unsigned int size);
//allocate a contiguous block of memory capable of
//holding nmemb * size bytes of user specified data. If
//nmemb or size are zero, a pointer to zero bytes of
//memory should be returned.
//The resulting block of memory will be filled with zero
//returns NULL on failure or pointer to new block on success
void *l_calloc(unsigned int nmemb, unsigned int size);
//Reallocate a block of memory pointed to by ptr. The contents
//of the original memory block are copied to the new memory
//block. Note that the new size may be larger, smaller, or the
//same as the current size. If the new memory allocation is
//successful, the original block of memory will be free'd.
//If ptr is NULL this function effectively becomes malloc(size)
//returns NULL on failure or pointer to new block on success
void *l_realloc(void *ptr, unsigned int size);
//release the memory pointed to by ptr. ptr may be NULL in which
//case no action is taken.
void l_free(void *ptr);
#endif