Replace SongList with struct songvec
Our linked-list implementation is wasteful and the SongList isn't modified enough to benefit from being a linked list. So use a more compact array of song pointers which saves ~200K on a library with ~9K songs (on x86-32).
This commit is contained in:
committed by
Max Kellermann
parent
afe6ce7210
commit
0bec1d3807
@@ -51,7 +51,7 @@ static int countSongsInDirectory(Directory * directory,
|
||||
{
|
||||
int *count = (int *)data;
|
||||
|
||||
*count += directory->songs->numberOfNodes;
|
||||
*count += directory->songs.nr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -362,7 +362,7 @@ static int sumSavedFilenameMemoryInDirectory(Directory * dir, void *data)
|
||||
return 0;
|
||||
|
||||
*sum += (strlen(getDirectoryPath(dir)) + 1 - sizeof(Directory *)) *
|
||||
dir->songs->numberOfNodes;
|
||||
dir->songs.nr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user