fxlibc/include/stdlib.h

32 lines
788 B
C
Raw Normal View History

2021-05-09 23:00:11 +02:00
#ifndef __STDLIB_H__
# define __STDLIB_H__
2020-09-17 19:27:01 +02:00
#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);
2021-05-09 23:00:11 +02:00
#endif /*__STDLIB_H__*/