From 4e1254fde19aef7bc7aa5326003e83cd93204db6 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 30 Jun 2024 21:11:30 +0200 Subject: [PATCH 1/2] Default to release build --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d27a91c..e1cb59a 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ CFLAGS += -Wno-unused-variable -Wno-unused-function CFLAGS += -Wno-unused-but-set-variable -Wno-unused-value -Wno-unused-label CFLAGS += -Wno-unused-result -Wno-unused-const-variable -ifeq ($(RELEASE), 1) +ifneq ($(DEBUG), 1) CFLAGS += -fno-exceptions -fno-asynchronous-unwind-tables -fno-ident CFLAGS += -fno-unwind-tables -fno-stack-protector -fno-plt -fno-pic CFLAGS += -O3 -std=c99 -march=native -mtune=native -fomit-frame-pointer From 9c746a10cf8604d9d1317db8c40b1d513ee1515e Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sun, 30 Jun 2024 21:11:49 +0200 Subject: [PATCH 2/2] Formatting --- ringbuf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ringbuf.c b/ringbuf.c index bd9c26e..5c004ba 100644 --- a/ringbuf.c +++ b/ringbuf.c @@ -24,10 +24,12 @@ rb_init(struct RingBuf *rb, rb_size_t capacity, ALLOC_T malloc_fn, rb->write_head = rb->buffer; rb->read_head = rb->buffer; - // Read from buffer at max position to force a segfault if theres an issue DEBUG_PRINT("Reading from buffer at position %d\n", rb->capacity * rb->struct_size); + + // Read from buffer at max position to force a segfault if theres an issue void *top = rb->buffer + (rb->capacity * rb->struct_size); + DEBUG_PRINT("Buffer top successfully read at virtual address: %p\n", &top); DEBUG_PRINT(