This commit is contained in:
Guillem George 2025-11-04 15:57:00 +01:00
parent 1e895ef74a
commit ac1b94ebc1
6 changed files with 43 additions and 0 deletions

6
.gitignore vendored
View file

@ -1,3 +1,9 @@
a.out
*~
*.swp
*.o
*.a
*.so
*.class
*.log
*.core

18
malloc/Makefile Normal file
View file

@ -0,0 +1,18 @@
CC=gcc
CFLAGS=
LDFLAGS=
SRCS=
OBJS=${SRC:.c=.o}
TARGET=libmalloc.so
library: $(OBJS)
$(CC) -shared -o $(TARGET) $^
debug:
check:
clean:
$(RM) *.o
$(RM) $(TARGET)

19
malloc/src/malloc.c Normal file
View file

@ -0,0 +1,19 @@
#include <stddef.h>
__attribute__((visibility("default"))) void *malloc(size_t size)
{
return NULL;
}
__attribute__((visibility("default"))) void free(void *ptr)
{}
__attribute__((visibility("default"))) void *realloc(void *ptr, size_t size)
{
return NULL;
}
__attribute__((visibility("default"))) void *calloc(size_t nmemb, size_t size)
{
return NULL;
}

BIN
malloc/tests/corruptionproof Executable file

Binary file not shown.

BIN
malloc/tests/memoryfootprint Executable file

Binary file not shown.

BIN
malloc/tests/speed Executable file

Binary file not shown.