This commit is contained in:
Guillem George 2025-11-04 19:13:31 +01:00
parent ac1b94ebc1
commit 7629201717
4 changed files with 20 additions and 5 deletions

View file

@ -1,15 +1,17 @@
CC=gcc CC=gcc
CFLAGS= CFLAGS=-std=c99 -pedantic -Werror -Wall -Wextra -Wvla -fvisibility=hidden -fPIC
LDFLAGS= CPPFLAGS=D_DEFAULT_SOURCE
LDFLAGS= -shared -Wl --no-undefined
SRCS= SRCS=
OBJS=${SRC:.c=.o} OBJS=${SRC:.c=.o}
TARGET=libmalloc.so TARGET=libmalloc.so
library: $(OBJS) library: $(OBJS)
$(CC) -shared -o $(TARGET) $^ $(CC) -o $(TARGET) $^
debug: debug: $(OBJS) $(TST_OBJS)
$(CC) -o $(TST_TARGET) $^
check: check:

View file

@ -0,0 +1,4 @@
#include "helpers.h"
size_t get_next_2power(size_t n)
{}

View file

@ -0,0 +1,8 @@
#ifndef HELPERS_H
#define HELPERS_H
#include <stddef.h>
size_t get_next_2power(size_t n);
#endif // ! HELPERS_H

View file

@ -2,6 +2,7 @@
__attribute__((visibility("default"))) void *malloc(size_t size) __attribute__((visibility("default"))) void *malloc(size_t size)
{ {
if (size == 0)
return NULL; return NULL;
} }