malloc.c
#include <stdio.h>
#include <stdlib.h>
int main (void) {
int n = 0;
while (1) {
if (malloc(1<<20) == NULL) {
printf("malloc failure after %d MiB\n", n);
return 0;
}
printf ("got %d MiB\n", ++n);
}
}
circle.yml
version: 2
jobs:
build:
docker:
- image: gcc
working_directory: /tmp/code
steps:
- checkout
- run: gcc -o malloc malloc.c
- run: ./malloc > /dev/null