aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-05 17:38:15 -0700
committerEric Wong <normalperson@yhbt.net>2008-10-05 17:38:15 -0700
commit36eba830fc097279f568e801b2d2a35a08004717 (patch)
tree26e2069be33a4a1c3afb44c6f1f34bcf78d84ed4 /src/song.h
parentc461fe6377836b486ad6dc6a1558a63e7c32eaa1 (diff)
downloadmpd-36eba830fc097279f568e801b2d2a35a08004717.tar.gz
mpd-36eba830fc097279f568e801b2d2a35a08004717.tar.xz
mpd-36eba830fc097279f568e801b2d2a35a08004717.zip
song: use flex arrays to store song->url
Reduce the number of allocations we make, so there's less pressure on the allocator and less overhead to keep track of the allocations in.
Diffstat (limited to 'src/song.h')
-rw-r--r--src/song.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/song.h b/src/song.h
index 6de962493..aebc8f044 100644
--- a/src/song.h
+++ b/src/song.h
@@ -23,6 +23,7 @@
#include "os_compat.h"
#include "tag.h"
#include "list.h"
+#include "gcc.h"
#define SONG_KEY "key: "
#define SONG_MTIME "mtime: "
@@ -38,12 +39,12 @@ enum song_type {
#define SONG_TIME "Time: "
typedef struct _Song {
- char *url;
struct mpd_tag *tag;
- enum song_type type;
struct _Directory *parentDir;
time_t mtime;
-} Song;
+ enum song_type type;
+ char url[1];
+} mpd_packed Song;
Song *newSong(const char *url, enum song_type type,
struct _Directory *parentDir);