diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-10-11 20:24:26 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-12 05:27:32 -0700 |
commit | c6ee14dca5d7336dad20a6057aa2a8006d4447b8 (patch) | |
tree | c0d5097a4b9664f03716a96639859118e9bd9db8 /src/directory.h | |
parent | aed02f0fedf56f6684cb98e33d0c616d4f80e81f (diff) | |
download | mpd-c6ee14dca5d7336dad20a6057aa2a8006d4447b8.tar.gz mpd-c6ee14dca5d7336dad20a6057aa2a8006d4447b8.tar.xz mpd-c6ee14dca5d7336dad20a6057aa2a8006d4447b8.zip |
directory: use mpd_sizeof_str_flex_array for path, too
This way we avoid unnecessary heap allocations.
Diffstat (limited to '')
-rw-r--r-- | src/directory.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/directory.h b/src/directory.h index 949df0c0e..546e55183 100644 --- a/src/directory.h +++ b/src/directory.h @@ -22,6 +22,7 @@ #include "song.h" #include "dirvec.h" #include "songvec.h" +#include "gcc.h" #define DIRECTORY_DIR "directory: " #define DIRECTORY_MTIME "mtime: " /* DEPRECATED, noop-read-only */ @@ -33,14 +34,14 @@ #define DIRECTORY_FS_CHARSET "fs_charset: " struct directory { - char *path; struct dirvec children; struct songvec songs; struct directory *parent; ino_t inode; dev_t device; unsigned stat; /* not needed if ino_t == dev_t == 0 is impossible */ -}; + char path[mpd_sizeof_str_flex_array]; +} mpd_packed; static inline int isRootDirectory(const char *name) { |