thistle-sdk
Thistle SDK documentation
Loading...
Searching...
No Matches
malloc.c File Reference
#include <stdio.h>
#include <malloc.h>
#include "../target/mallocng.h"

Macros

#define malloc(size)   tma_malloc(size)
 
#define free(ptr)   tma_free(ptr)
 

Functions

int main ()
 

Macro Definition Documentation

◆ free

#define free (   ptr)    tma_free(ptr)
Examples
malloc.c.

◆ malloc

#define malloc (   size)    tma_malloc(size)
Examples
malloc.c.

Function Documentation

◆ main()

int main ( )
Examples
malloc.c, prio.c, and tsc.c.
19 {
20 int *p = malloc(4);
21 if (p == NULL) {
22 printf("Failed to allocate memory\n");
23 return 1;
24 }
25 *p = 42;
26 printf("%d\n", *p);
27 free(p);
28 return 0;
29}
#define malloc(size)
Definition: malloc.c:16
#define free(ptr)
Definition: malloc.c:17

References free, and malloc.