From 06bc88b315e19510f649b882eebef0140a224981 Mon Sep 17 00:00:00 2001 From: rw-r-r-0644 Date: Sat, 29 Sep 2018 12:04:18 +0200 Subject: [PATCH] add further optimizations to make romfs faster --- Makefile | 1 + source/romfs.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0c7afac..ba1b026 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,7 @@ SOURCES := source CFILES := $(foreach dir,$(SOURCES),$(wildcard $(dir)/*.c)) OFILES := $(CFILES:.c=.o) INSTALLDIR ?= $(PORTLIBS) +CFLAGS += -O3 #--------------------------------------------------------------------------------- # Build rules diff --git a/source/romfs.c b/source/romfs.c index c7fb61b..ecf4f4c 100644 --- a/source/romfs.c +++ b/source/romfs.c @@ -14,6 +14,7 @@ #include #include #include +#include //!---------------------------------------------------------------------- //! Filesystem tree functions @@ -253,7 +254,7 @@ static ssize_t romfs_read(struct _reent *r, void *fd, char *ptr, size_t len) { return 0; if((fobj->pos + len) > fobj->fsnode->size) len = fobj->fsnode->size - fobj->pos; - memcpy(ptr, fobj->fsnode->cont + fobj->pos, len); + OSBlockMove(ptr, fobj->fsnode->cont + fobj->pos, len, FALSE); fobj->pos += len; return len; }