Files
RedBear-OS/tests/stdlib/alloc.c
T
Tibor Nagy 4381bb2a22 tests: Remove redundant return statements
When the execution reaches the end of the main functions, they implicitly return a successful status.
2019-02-20 21:09:03 +01:00

28 lines
556 B
C

#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char * ptr = (char *)malloc(256);
printf("malloc %p\n", ptr);
int i;
for(i = 0; i < 256; i++) {
ptr[i] = (char)i;
}
free(ptr);
char * ptrc = (char *)calloc(256, 1);
printf("calloc %p\n", ptrc);
for(i = 0; i < 256; i++) {
ptrc[i] = (char)i;
}
free(ptrc);
char * ptra = (char *)memalign(256, 256);
printf("memalign %p\n", ptra);
for(i = 0; i < 256; i++) {
ptra[i] = (char)i;
}
free(ptra);
}