Skip to content

Instantly share code, notes, and snippets.

@kimh
Last active April 6, 2017 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimh/d7a93955fbebd7cb012cdc8ece0651df to your computer and use it in GitHub Desktop.
Save kimh/d7a93955fbebd7cb012cdc8ece0651df to your computer and use it in GitHub Desktop.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment