]> code.delx.au - pulseaudio/commitdiff
memtrap: add a bit of documentation for memtrap
authorLennart Poettering <lennart@poettering.net>
Tue, 21 Apr 2009 21:02:17 +0000 (23:02 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Apr 2009 21:02:17 +0000 (23:02 +0200)
src/pulsecore/memtrap.h

index 6cad296c12b55bdac6489944d86ce270be8303f3..f7da70830c75c90070a02e4a19e2d5efdd02b5e9 100644 (file)
 
 #include <pulsecore/macro.h>
 
+/* This subsystem will trap SIGBUS on specific memory regions. The
+ * regions will be remapped to anonymous memory (i.e. writable NUL
+ * bytes) on SIGBUS, so that execution of the main program can
+ * continue though with memory having changed beneath its hands. With
+ * pa_memtrap_is_good() it is possible to query if a memory region is
+ * still 'good' i.e. no SIGBUS has happened yet for it.
+ *
+ * Intended usage is to handle memory mapped in which is controlled by
+ * other processes that might execute ftruncate() or when mapping in
+ * hardware resources that might get invalidated when unplugged. */
+
 typedef struct pa_memtrap pa_memtrap;
 
 pa_memtrap* pa_memtrap_add(const void *start, size_t size);