Directory: don't allocate stat information dynamically

This should save a few thousand ops.  Not worth it to malloc
for such a small (3-words on 32-bit ARM and x86) structures.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
Eric Wong
2008-09-23 20:47:45 +02:00
committed by Max Kellermann
parent 3263dbe517
commit d095d52ed4
2 changed files with 22 additions and 50 deletions

View File

@@ -23,17 +23,14 @@
typedef List DirectoryList;
typedef struct _DirectoryStat {
ino_t inode;
dev_t device;
} DirectoryStat;
typedef struct _Directory {
char *path;
DirectoryList *subDirectories;
SongList *songs;
struct _Directory *parent;
DirectoryStat *stat;
ino_t inode;
dev_t device;
unsigned stat; /* not needed if ino_t == dev_t == 0 is impossible */
} Directory;
void readDirectoryDBIfUpdateIsFinished(void);