feat: ✨ Create memory stresser

This commit is contained in:
lga committed 2024-09-13 17:31:34 +02:00
1 parent 208a583701
commit ed935bba14
2 files changed
+26

No files matched your search

+11
View File
@@ -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)
+15
View File
@@ -0,0 +1,15 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
while (1) {
void* temp = malloc(1024);
*((long int*) temp) = 1024;
if (temp == NULL) {
printf("Memory is full\n");
break;
}
}
return 0;
}