On 2010/01/06 00:15, Jeff Frasca <phaed...@u.washington.edu> wrote: >> - why use a temporary file? You could either allocate all song URIs >> on the heap (may be expensive, but I don't think that's a problem) >> or open a second MPD connection for adding while receiving songs on >> the first one >> >> - why are you adding _all_ songs to the temporary file, and apply >> regex later? You could save a lot of space by doing the filter >> first > > For both of these, I'm making the kernel do my memory management for me. > The point of all the songs in the temp file is that I can sort them (I > haven't added that yet), which I really want it to do so that the adds > come out in sort order--which will add my albums in track order instead > of interleaved (I use one directory per artist to manage my music files).
No need to sort, MPD has a defined sorting order for songs: http://git.musicpd.org/cgit/master/mpd.git/tree/src/songvec.c#n92 The only advantage of a temporary file I can think of is that the kernel doesn't need to write the pages to the swap file, it can just drop them when memory gets low. >> - you can close(tmpf) right after mmap(), the file descriptor isn't >> needed after the mmap has been established > > Good point. I didn't realize that was ok. That's how ld.so links with shared libraries: open(), mmap(), close(). > I can add a check for regex.h into the configure script and turn on > MPC_SMALL_BUILD if it doesn't work. No, the other way round, please: if _not_ on the small build, check for regex.h, and just disable the "radd" command. mingw32 users might find other mpc extensions useful (such as bash completion). > I single boot Slackware Linux. So, no, I cannot. So there's no mingw32 package for Slackware? In this case, it's enough to just test the build, because most portability problems appear at built time and not at run time. ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team