fxlibc/include/stdlib.h

32 lines
800 B
C
Raw Normal View History

2020-09-17 19:27:01 +02:00
#ifndef __LIB_STDLIB_H__
# define __LIB_STDLIB_H__
#include <stddef.h>
#include <stdint.h>
//---
// Dynamic memory management
//---
/* Allocate SIZE bytes of memory. */
2020-09-17 19:27:01 +02:00
extern void *malloc(size_t size);
/* Allocate NMEMB elements of SIZE bytes each, all initialized to 0. */
2020-09-17 19:27:01 +02:00
extern void *calloc(size_t nmemb, size_t size);
/*
** Re-allocate the previously allocated block in PTR, making the new block
** SIZE bytes long.
*/
2020-09-17 19:27:01 +02:00
extern void *realloc(void *ptr, size_t size);
/*
** Re-allocate the previously allocated block in PTR, making the new block large
** enough for NMEMB elements of SIZE bytes each.
*/
2020-09-17 19:27:01 +02:00
extern void *reallocarray(void *ptr, size_t nmemb, size_t size);
/* Free a block allocated by `malloc', `realloc' or `calloc'. */
2020-09-17 19:27:01 +02:00
extern void free(void *ptr);
#endif /*__LIB_STDLIB_H__*/