Put a struct in iram for a small speedup on coldfire

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14973 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Nils Wallménius 2007-10-03 20:38:04 +00:00
parent 1ba018bb01
commit 4ebe69293c

View file

@ -24,6 +24,8 @@ extern struct plugin_api * rb;
struct Track * readTrack(int file); struct Track * readTrack(int file);
int readID(int file); int readID(int file);
struct MIDIfile midi_file IBSS_ATTR;
struct MIDIfile * loadFile(char * filename) struct MIDIfile * loadFile(char * filename)
{ {
struct MIDIfile * mfload; struct MIDIfile * mfload;
@ -35,14 +37,7 @@ struct MIDIfile * loadFile(char * filename)
return NULL; return NULL;
} }
mfload = (struct MIDIfile*)malloc(sizeof(struct MIDIfile)); mfload = &midi_file;
if(mfload==NULL)
{
rb->close(file);
printf("Could not allocate memory for MIDIfile struct");
return NULL;
}
rb->memset(mfload, 0, sizeof(struct MIDIfile)); rb->memset(mfload, 0, sizeof(struct MIDIfile));