From 4ebe69293caa4bfbd1f554a563b1616ab5e87e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Wed, 3 Oct 2007 20:38:04 +0000 Subject: [PATCH] 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 --- apps/plugins/midi/midifile.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/apps/plugins/midi/midifile.c b/apps/plugins/midi/midifile.c index 1fa648ff50..7b59ed2cb6 100644 --- a/apps/plugins/midi/midifile.c +++ b/apps/plugins/midi/midifile.c @@ -24,6 +24,8 @@ extern struct plugin_api * rb; struct Track * readTrack(int file); int readID(int file); +struct MIDIfile midi_file IBSS_ATTR; + struct MIDIfile * loadFile(char * filename) { struct MIDIfile * mfload; @@ -35,14 +37,7 @@ struct MIDIfile * loadFile(char * filename) return NULL; } - mfload = (struct MIDIfile*)malloc(sizeof(struct MIDIfile)); - - if(mfload==NULL) - { - rb->close(file); - printf("Could not allocate memory for MIDIfile struct"); - return NULL; - } + mfload = &midi_file; rb->memset(mfload, 0, sizeof(struct MIDIfile));