Skip to content

Commit

Permalink
add further optimizations to make romfs faster
Browse files Browse the repository at this point in the history
  • Loading branch information
rw-r-r-0644 committed Sep 29, 2018
1 parent 6b1f991 commit 06bc88b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SOURCES := source
CFILES := $(foreach dir,$(SOURCES),$(wildcard $(dir)/*.c))
OFILES := $(CFILES:.c=.o)
INSTALLDIR ?= $(PORTLIBS)
CFLAGS += -O3

#---------------------------------------------------------------------------------
# Build rules
Expand Down
3 changes: 2 additions & 1 deletion source/romfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <sys/param.h>
#include <stdint.h>
#include <unistd.h>
#include <coreinit/memory.h>

//!----------------------------------------------------------------------
//! Filesystem tree functions
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 06bc88b

Please sign in to comment.