Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 24718b4956 | |||
| 7687ffa710 |
@@ -12,10 +12,10 @@ endif
|
|||||||
BUILDDIR = build
|
BUILDDIR = build
|
||||||
|
|
||||||
SOURCES = $(wildcard src/*.c)
|
SOURCES = $(wildcard src/*.c)
|
||||||
OBJECTS = $(addprefix $(BUILDDIR)/,$(SOURCES:.c=.o))
|
|
||||||
DEPS = $(addprefix $(BUILDDIR)/,$(SOURCES:.c=.d))
|
|
||||||
LIB = liblilalloc
|
|
||||||
TEST_SOURCES = $(wildcard test/*.c)
|
TEST_SOURCES = $(wildcard test/*.c)
|
||||||
|
OBJECTS = $(addprefix $(BUILDDIR)/,$(SOURCES:.c=.o))
|
||||||
|
DEPS = $(addprefix $(BUILDDIR)/,$(SOURCES:.c=.d)) $(addprefix $(BUILDDIR)/,$(TEST_SOURCES:.c=.d))
|
||||||
|
LIB = liblilalloc
|
||||||
TEST_BINS = $(patsubst test/%.c,$(BUILDDIR)/test/%,$(TEST_SOURCES))
|
TEST_BINS = $(patsubst test/%.c,$(BUILDDIR)/test/%,$(TEST_SOURCES))
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
|||||||
+2
-1
@@ -152,7 +152,8 @@ static inline void *larena_alloc(LArena *arena, size_t sz)
|
|||||||
|
|
||||||
// Allocate @sz bytes from the LArena, returned pointer is aligned to @align
|
// Allocate @sz bytes from the LArena, returned pointer is aligned to @align
|
||||||
// Returns NULL if not enough space
|
// Returns NULL if not enough space
|
||||||
static inline void *larena_alloc_aligned(LArena *arena, size_t sz, unsigned int align) [[gnu::alloc_align(3)]]
|
[[gnu::alloc_align(3)]]
|
||||||
|
static inline void *larena_alloc_aligned(LArena *arena, size_t sz, unsigned int align)
|
||||||
{
|
{
|
||||||
assert(align != 0);
|
assert(align != 0);
|
||||||
assert((align & (align - 1)) == 0); // power of 2
|
assert((align & (align - 1)) == 0); // power of 2
|
||||||
|
|||||||
Reference in New Issue
Block a user