aboutsummaryrefslogtreecommitdiffstats
path: root/src/song.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-06 18:48:45 +0200
committerMax Kellermann <max@duempel.org>2008-10-06 18:48:45 +0200
commit22e40b61cc0166dcda15b7146724928368201b07 (patch)
tree2f106c41c80b699e687b88842b9589f5c357089e /src/song.c
parent267b2cd6e668fb380a53b1377143a5cc7ce949ea (diff)
downloadmpd-22e40b61cc0166dcda15b7146724928368201b07.tar.gz
mpd-22e40b61cc0166dcda15b7146724928368201b07.tar.xz
mpd-22e40b61cc0166dcda15b7146724928368201b07.zip
song: don't make the struct packed
The "packed" attribute may have negative side effects on performance. Remove the "packed" attribute, and increase the size of "song.url" to a multiple of the machine word size.
Diffstat (limited to '')
-rw-r--r--src/song.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/song.c b/src/song.c
index 3081dec4e..6d689c5c8 100644
--- a/src/song.c
+++ b/src/song.c
@@ -32,7 +32,7 @@ Song *
song_alloc(const char *url, enum song_type type, struct _Directory *parent)
{
size_t urllen = strlen(url);
- Song *song = xmalloc(sizeof(Song) + urllen);
+ Song *song = xmalloc(sizeof(*song) - sizeof(song->url) + urllen + 1);
song->tag = NULL;
memcpy(song->url, url, urllen + 1);