From 88f4e0af29863d07505f810f7819f0e471a27427 Mon Sep 17 00:00:00 2001 From: Maschell Date: Fri, 21 Jan 2022 19:52:35 +0100 Subject: [PATCH] Reduce the filesize by avoid "new" and any exceptions --- Makefile | 2 +- source/memory_mapping.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 02ea820..da3cd0c 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ CFLAGS := -g -Wall -O2 -ffunction-sections\ CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__ -CXXFLAGS := $(CFLAGS) -std=c++17 +CXXFLAGS := $(CFLAGS) -std=c++17 -fno-exceptions -fno-rtti ASFLAGS := -g $(ARCH) LDFLAGS = -g $(ARCH) $(RPXSPECS) -Wl,-Map,$(notdir $*.map) -T$(WUMS_ROOT)/share/libkernel.ld -T$(WUMS_ROOT)/share/libfunctionpatcher.ld $(WUMSSPECS) diff --git a/source/memory_mapping.cpp b/source/memory_mapping.cpp index c849254..7d63486 100644 --- a/source/memory_mapping.cpp +++ b/source/memory_mapping.cpp @@ -17,9 +17,8 @@ void runOnAllCores(CThread::Callback callback, void *callbackArg, int32_t iAttr int32_t aff[] = {CThread::eAttributeAffCore2, CThread::eAttributeAffCore1, CThread::eAttributeAffCore0}; for (int i: aff) { - CThread *thread = CThread::create(callback, callbackArg, iAttr | i, iPriority, iStackSize); - thread->resumeThread(); - delete thread; + CThread thread(iAttr | i, iPriority, iStackSize, callback, callbackArg); + thread.resumeThread(); } }