diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..577bf86 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +CC := gcc +CFLAGS := -Wall -Wextra -Werror -pedantic -std=c99 -g +OBJS := main.o +TARGET := main + +$(TARGET): $(OBJS) + $(CC) $(CFLAGS) -o $@ $^ + +.PHONY: clean +clean: + rm -f $(OBJS) $(TARGET) diff --git a/main.c b/main.c new file mode 100644 index 0000000..5b8fd5c --- /dev/null +++ b/main.c @@ -0,0 +1,15 @@ +#include +#include + +int main() { + while (1) { + void* temp = malloc(1024); + *((long int*) temp) = 1024; + if (temp == NULL) { + printf("Memory is full\n"); + break; + } + + } + return 0; +}