mirror of
https://github.com/wiiu-env/homebrew_on_menu_plugin.git
synced 2025-02-16 18:19:18 +01:00
Improve file reading speeds by using an aligned buffer
This commit is contained in:
parent
005e65e490
commit
08a4176418
@ -20,13 +20,13 @@ int32_t FSUtils::LoadFileToMem(const char *filepath, uint8_t **inbuffer, uint32_
|
|||||||
uint32_t filesize = lseek(iFd, 0, SEEK_END);
|
uint32_t filesize = lseek(iFd, 0, SEEK_END);
|
||||||
lseek(iFd, 0, SEEK_SET);
|
lseek(iFd, 0, SEEK_SET);
|
||||||
|
|
||||||
uint8_t *buffer = (uint8_t *) malloc(filesize);
|
uint8_t *buffer = (uint8_t *) memalign(0x40, filesize);
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
close(iFd);
|
close(iFd);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t blocksize = 0x4000;
|
uint32_t blocksize = 0x100000;
|
||||||
uint32_t done = 0;
|
uint32_t done = 0;
|
||||||
int32_t readBytes = 0;
|
int32_t readBytes = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user