From b843ae1dde619605a318002b2c2326a9cce380f0 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 6 Oct 2008 18:48:45 +0200 Subject: 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. --- src/song.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/song.c') diff --git a/src/song.c b/src/song.c index c9301386d..03f65dd0d 100644 --- a/src/song.c +++ b/src/song.c @@ -37,7 +37,7 @@ static Song * song_alloc(const char *url, Directory *parent) assert(url); urllen = strlen(url); assert(urllen); - song = xmalloc(sizeof(Song) + urllen); + song = xmalloc(sizeof(*song) - sizeof(song->url) + urllen + 1); song->tag = NULL; memcpy(song->url, url, urllen + 1); -- cgit v1.2.3