1. 29 Dec, 2008 1 commit
    • Max Kellermann's avatar
      removed os_compat.h · 95b3430f
      Max Kellermann authored
      Only include headers which are really needed.  os_compat.h aimed to
      make MPD easily portable, but was never actually made portable.
      95b3430f
  2. 16 Dec, 2008 1 commit
  3. 01 Nov, 2008 1 commit
  4. 31 Oct, 2008 1 commit
  5. 15 Oct, 2008 2 commits
  6. 14 Oct, 2008 2 commits
  7. 13 Oct, 2008 2 commits
  8. 08 Oct, 2008 10 commits
  9. 07 Oct, 2008 2 commits
    • Eric Wong's avatar
      directory: serialize song deletes from playlist during update · 7d8c9cc7
      Eric Wong authored
      This makes the update code thread-safe and doesn't penalize
      the playlist code by complicating it with complicated and
      error-prone locks (and the associated overhead, not everybody
      has a thread-implementation as good as NPTL).
      
      The update task blocks during the delete; but the update task is
      a slow task anyways so we can block w/o people caring too much.
      
      This was also our only freeSong call site, so remove that
      function.
      
      Note that deleting entire directories is not fully thread-safe,
      yet; as their traversals are not yet locked.
      7d8c9cc7
    • Eric Wong's avatar
      Assert if we don't have song or song->url set · 0d34815f
      Eric Wong authored
      song objects cannot exist without a path or URL
      0d34815f
  10. 06 Oct, 2008 5 commits
    • Eric Wong's avatar
      song: stop storing song_type · f1c53fe0
      Eric Wong authored
      We already know if a song is a URL or not based on whether it
      has parentDir defined or not.  Hopefully one day in the future
      we can drop HTTP support from MPD entirely when an HTTP
      filesystem comes along and we can access streams via open(2).
      f1c53fe0
    • Max Kellermann's avatar
      song: don't make the struct packed · 22e40b61
      Max Kellermann authored
      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.
      22e40b61
    • Eric Wong's avatar
      song: use flex arrays to store song->url · 267b2cd6
      Eric Wong authored
      Reduce the number of allocations we make, so there's less
      pressure on the allocator and less overhead to keep track
      of the allocations in.
      267b2cd6
    • Eric Wong's avatar
      song: get rid of newNullSong() · 43761441
      Eric Wong authored
      It didn't save us any lines of code nor did it do anything
      useful since we would overwrite everything anyways.
      43761441
    • Eric Wong's avatar
      song: call freeJustSong if newSong fails · dc245f38
      Eric Wong authored
      There's no reason to scan the playlist for a song we
      just allocated.
      dc245f38
  11. 29 Sep, 2008 2 commits
    • Max Kellermann's avatar
      decoder: renamed plugin methods · 21d3d300
      Max Kellermann authored
      Why have a "_func" prefix on all method names?  Also don't typedef the
      methods, there is no advantage in that.
      21d3d300
    • Max Kellermann's avatar
      song: converted "type" to enum · 35d51962
      Max Kellermann authored
      Having an enum type is much nicer than an anonymous integer plus CPP
      macros.  Note that the old code didn't save any space by declaring the
      variable 8 bit, due to padding.
      35d51962
  12. 26 Sep, 2008 1 commit
  13. 23 Sep, 2008 1 commit
    • Eric Wong's avatar
      Replace SongList with struct songvec · 0bec1d38
      Eric Wong authored
      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).
      0bec1d38
  14. 07 Sep, 2008 2 commits
    • Max Kellermann's avatar
      song: moved code to song_print.c, song_save.c · 75aa8dad
      Max Kellermann authored
      Move everything which dumps song information (via tag_print.c) to a
      separate source file.  song_print.c gets code which writes song data
      to the client; song_save.c is responsible for serializing songs from
      the tag cache.
      75aa8dad
    • Max Kellermann's avatar
      tag: moved code to tag_print.c · 386c3031
      Max Kellermann authored
      Move everything which dumps a tag to a file descriptor to tag_print.c.
      This relaxes dependencies and splits the code into smaller parts.
      386c3031
  15. 06 Sep, 2008 1 commit
    • Eric Wong's avatar
      tag: fix segfault on update · 092bdf3d
      Eric Wong authored
      clearMpdTag could be called on a tag that was still in a
      tag_begin_add transaction before tag_end_add is called.  This
      was causing free() to attempt to operate on bulk.items; which is
      un-free()-able.  Now instead we unmark the bulk.busy to avoid
      committing the tags to the heap only to be immediately freed.
      
      Additionally, we need to remember to call tag_end_add() when
      a song is updated before we NULL song->tag to avoid tripping
      an assertion the next time tag_begin_add() is called.
      092bdf3d
  16. 29 Aug, 2008 3 commits
    • Max Kellermann's avatar
      tag: try not to reallocate tag.items in every add() call · 1aa34573
      Max Kellermann authored
      If many tag_items are added at once while the tag cache is being
      loaded, manage these items in a static fixed list, instead of
      reallocating the list with every newly created item.  This reduces
      heap fragmentation.
      
      Massif results again:
      
       mk before:  total 12,837,632; useful 10,626,383; extra 2,211,249
       mk now:     total 12,736,720; useful 10,626,383; extra 2,110,337
      
      The "useful" value is the same since this patch only changes the way
      we allocate the same amount of memory, but heap fragmentation was
      reduced by 5%.
      1aa34573
    • Max Kellermann's avatar
      song: don't export newNullSong() · 03152206
      Max Kellermann authored
      The function newNullSong() is only used internally in song.c.
      03152206
    • Max Kellermann's avatar
      tag: renamed functions, no CamelCase · 91502cd7
      Max Kellermann authored
      91502cd7
  17. 26 Aug, 2008 3 commits