pulsecore/pipe.c pulsecore/pipe.h \
pulsecore/poll.c pulsecore/poll.h \
pulsecore/prioq.c pulsecore/prioq.h \
+ pulsecore/memtrap.c pulsecore/memtrap.h \
pulsecore/proplist-util.c pulsecore/proplist-util.h \
pulsecore/pstream-util.c pulsecore/pstream-util.h \
pulsecore/pstream.c pulsecore/pstream.h \
pulsecore/sconv-s16le.c pulsecore/sconv-s16le.h \
pulsecore/sconv.c pulsecore/sconv.h \
pulsecore/shared.c pulsecore/shared.h \
- pulsecore/memtrap.c pulsecore/memtrap.h \
pulsecore/shm.c pulsecore/shm.h \
pulsecore/sink-input.c pulsecore/sink-input.h \
pulsecore/sink.c pulsecore/sink.h \
#include <pulsecore/thread.h>
#include <pulsecore/once.h>
#include <pulsecore/shm.h>
+#include <pulsecore/memtrap.h>
#ifdef HAVE_DBUS
#include <pulsecore/dbus-shared.h>
#endif
pa_rtsig_configure(SIGRTMIN, SIGRTMAX-1);
#endif
+ pa_memtrap_install();
+
pa_assert_se(mainloop = pa_mainloop_new());
if (!(c = pa_core_new(pa_mainloop_get_api(mainloop), !conf->disable_shm, conf->shm_size))) {
#include <pulsecore/macro.h>
#include <pulsecore/flist.h>
#include <pulsecore/core-util.h>
+#include <pulsecore/memtrap.h>
#include "memblock.h"
struct pa_memimport_segment {
pa_memimport *import;
pa_shm memory;
+ pa_memtrap *trap;
unsigned n_blocks;
};
seg->import = i;
seg->n_blocks = 0;
+ seg->trap = pa_memtrap_add(seg->memory.ptr, seg->memory.size);
pa_hashmap_put(i->segments, PA_UINT32_TO_PTR(shm_id), seg);
return seg;
pa_hashmap_remove(seg->import->segments, PA_UINT32_TO_PTR(seg->memory.id));
pa_shm_free(&seg->memory);
+
+ if (seg->trap)
+ pa_memtrap_remove(seg->trap);
+
pa_xfree(seg);
}