~diwic/ubuntu/lucid/pulseaudio/bugfixes

« back to all changes in this revision

Viewing changes to src/pulsecore/memblock.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-05-05 14:18:20 UTC
  • mfrom: (1.2.4 upstream) (1.1.8 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090505141820-rrr2mtdd1jkllvr8
Tags: 1:0.9.15-1ubuntu1
* Merge from unreleased Debian pulseaudio git, remaining changes:
  - epoch (my stupid fault :S)
  - Don't build against, and create jack package. Jack is not in main
  - use linear resampler to work better with lack of PREEMPT in jaunty's
    -generic kernel config, also change buffer size
  - Add alsa configuration files to route alsa applications via pulseaudio
  - Move libasound2-plugins from Recommends to Depends
  - Add pm-utils sleep hook to suspend (and resume) users' pulseaudio
    daemons
  - patch to fix source/sink and suspend-on-idle race
  - Make initscript more informative in the default case of per-user
    sessions
  - create /var/run/pulse, and make restart more robust
  - add status check for system wide pulseaudio instance
  - LSB {Required-*,Should-*} should specify hal instead of dbus,
    since hal is required (and already requires dbus)
  - indicate that the system pulseaudio instance is being started from the init
    script
  - Install more upstream man pages
  - Link to pacat for parec man page
  - check whether pulseaudio is running before preloading the padsp library
  - Add DEB_OPT_FLAG = -O3 as per recommendation from
    pulseaudio-discuss/2007-December/001017.html
  - cache /usr/share/sounds/ubuntu/stereo/ wav files on pulseaudio load
  - disable glitch free (use tsched=0)
  - Generate a PO template on build
  - add special case to disable pulseaudio loading if accessibility/speech
    is being used
  - the sd wrapper script should not load pulseaudio if pulseaudio is being
    used as a system service
  - add a pulseaudio apport hook
  - fix some typos in README.Debian
  - demote paprefs to suggests
  - drop padevchooser(Recommends) and pavucontrol (Suggests)
  - drop libasyncns-dev build dependency, its in universe
* add libudev-dev as a build-dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
 
58
58
#define PA_MEMEXPORT_SLOTS_MAX 128
59
59
 
60
 
#define PA_MEMIMPORT_SLOTS_MAX 128
 
60
#define PA_MEMIMPORT_SLOTS_MAX 160
61
61
#define PA_MEMIMPORT_SEGMENTS_MAX 16
62
62
 
63
63
struct pa_memblock {
745
745
    pa_flist_free(p->free_slots, NULL);
746
746
 
747
747
    if (pa_atomic_load(&p->stat.n_allocated) > 0) {
748
 
/*         raise(SIGTRAP);  */
749
 
        pa_log_warn("Memory pool destroyed but not all memory blocks freed! %u remain.", pa_atomic_load(&p->stat.n_allocated));
 
748
 
 
749
        /* Ouch, somebody is retaining a memory block reference! */
 
750
 
 
751
#ifdef DEBUG_REF
 
752
        unsigned i;
 
753
        pa_flist *list;
 
754
 
 
755
        /* Let's try to find at least one of those leaked memory blocks */
 
756
 
 
757
        list = pa_flist_new(p->n_blocks);
 
758
 
 
759
        for (i = 0; i < (unsigned) pa_atomic_load(&p->n_init); i++) {
 
760
            struct mempool_slot *slot;
 
761
            pa_memblock *b, *k;
 
762
 
 
763
            slot = (struct mempool_slot*) ((uint8_t*) p->memory.ptr + (p->block_size * (size_t) i));
 
764
            b = mempool_slot_data(slot);
 
765
 
 
766
            while ((k = pa_flist_pop(p->free_slots))) {
 
767
                while (pa_flist_push(list, k) < 0)
 
768
                    ;
 
769
 
 
770
                if (b == k)
 
771
                    break;
 
772
            }
 
773
 
 
774
            if (!k)
 
775
                pa_log("REF: Leaked memory block %p", b);
 
776
 
 
777
            while ((k = pa_flist_pop(list)))
 
778
                while (pa_flist_push(p->free_slots, k) < 0)
 
779
                    ;
 
780
        }
 
781
 
 
782
        pa_flist_free(list, NULL);
 
783
 
 
784
#endif
 
785
 
 
786
        pa_log_error("Memory pool destroyed but not all memory blocks freed! %u remain.", pa_atomic_load(&p->stat.n_allocated));
 
787
 
 
788
/*         PA_DEBUG_TRAP; */
750
789
    }
751
790
 
752
791
    pa_shm_free(&p->memory);