[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.12-127-g82c46f2
Lennart Poettering
gitmailer-noreply at 0pointer.de
Fri Oct 3 15:14:09 PDT 2008
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The master branch has been updated
from c0815deb4add5ae4598de7c2c0589d1f5dc1c641 (commit)
- Log -----------------------------------------------------------------
82c46f2... do not cleanup staticly allocated memory unless we are in valgrind mode
3c19352... show valgrind status on startup
9b00664... instead of checking for directly use new function pa_in_valgrind()
8222f12... add new API function pa_in_valgrind() to check for
7a1a147... rename pa_cvolume_snprint_dB to pa_sw_cvolume_snprint_dB since it is useful only for software volumes
-----------------------------------------------------------------------
Summary of changes:
src/daemon/caps.c | 4 ++--
src/daemon/main.c | 2 ++
src/map-file | 2 +-
src/pulse/volume.c | 2 +-
src/pulse/volume.h | 4 ++--
src/pulsecore/core-util.c | 15 +++++++++++++++
src/pulsecore/core-util.h | 13 +++++++++++++
src/pulsecore/flist.h | 3 +++
src/pulsecore/log.c | 3 +++
src/pulsecore/thread.h | 3 +++
src/tests/voltest.c | 4 ++--
11 files changed, 47 insertions(+), 8 deletions(-)
-----------------------------------------------------------------------
commit 7a1a1478819c0f4716f0612f1121a0429f455fa9
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Oct 3 22:21:27 2008 +0200
rename pa_cvolume_snprint_dB to pa_sw_cvolume_snprint_dB since it is
useful only for software volumes
diff --git a/src/map-file b/src/map-file
index 50cb780..7211914 100644
--- a/src/map-file
+++ b/src/map-file
@@ -105,7 +105,7 @@ pa_cvolume_max;
pa_cvolume_remap;
pa_cvolume_set;
pa_cvolume_snprint;
-pa_cvolume_snprint_dB;
+pa_sw_cvolume_snprint_dB;
pa_cvolume_valid;
pa_ext_stream_restore_delete;
pa_ext_stream_restore_read;
diff --git a/src/pulse/volume.c b/src/pulse/volume.c
index 0ef02d9..0412819 100644
--- a/src/pulse/volume.c
+++ b/src/pulse/volume.c
@@ -170,7 +170,7 @@ char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c) {
return s;
}
-char *pa_cvolume_snprint_dB(char *s, size_t l, const pa_cvolume *c) {
+char *pa_sw_cvolume_snprint_dB(char *s, size_t l, const pa_cvolume *c) {
unsigned channel;
pa_bool_t first = TRUE;
char *e;
diff --git a/src/pulse/volume.h b/src/pulse/volume.h
index 9f6e5f0..bfd8ca5 100644
--- a/src/pulse/volume.h
+++ b/src/pulse/volume.h
@@ -145,10 +145,10 @@ char *pa_cvolume_snprint(char *s, size_t l, const pa_cvolume *c);
* any release without warning and without being considered API or ABI
* breakage. You should not use this definition anywhere where it
* might become part of an ABI. \since 0.9.13 */
-#define PA_CVOLUME_SNPRINT_DB_MAX 448
+#define PA_SW_CVOLUME_SNPRINT_DB_MAX 448
/** Pretty print a volume structure but show dB values. \since 0.9.13 */
-char *pa_cvolume_snprint_dB(char *s, size_t l, const pa_cvolume *c);
+char *pa_sw_cvolume_snprint_dB(char *s, size_t l, const pa_cvolume *c);
/** Return the average volume of all channels */
pa_volume_t pa_cvolume_avg(const pa_cvolume *a) PA_GCC_PURE;
diff --git a/src/tests/voltest.c b/src/tests/voltest.c
index bbf3ea1..5bfc97e 100644
--- a/src/tests/voltest.c
+++ b/src/tests/voltest.c
@@ -17,14 +17,14 @@ int main(int argc, char *argv[]) {
}
for (v = PA_VOLUME_MUTED; v <= PA_VOLUME_NORM*2; v += 256) {
- char s[PA_CVOLUME_SNPRINT_MAX], t[PA_CVOLUME_SNPRINT_DB_MAX];
+ char s[PA_CVOLUME_SNPRINT_MAX], t[PA_SW_CVOLUME_SNPRINT_DB_MAX];
pa_cvolume_set(&cv, 2, v);
printf("Volume: %3i [%s] [%s]\n",
v,
pa_cvolume_snprint(s, sizeof(s), &cv),
- pa_cvolume_snprint_dB(t, sizeof(t), &cv));
+ pa_sw_cvolume_snprint_dB(t, sizeof(t), &cv));
}
commit 8222f1200fc2db90fdfde17f5f958f04272f9ade
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 4 00:10:43 2008 +0200
add new API function pa_in_valgrind() to check for
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 0bc5cb4..dde34d7 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -2472,3 +2472,18 @@ char *pa_uname_string(void) {
return pa_sprintf_malloc("%s %s %s %s", u.sysname, u.machine, u.release, u.version);
}
+
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+pa_bool_t pa_in_valgrind(void) {
+ static int b = 0;
+
+ /* To make heisenbugs a bit simpler to find we check for $VALGRIND
+ * here instead of really checking whether we run in valgrind or
+ * not. */
+
+ if (b < 1)
+ b = getenv("VALGRIND") ? 2 : 1;
+
+ return b > 1;
+}
+#endif
diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
index df8ce3f..fd6ee89 100644
--- a/src/pulsecore/core-util.h
+++ b/src/pulsecore/core-util.h
@@ -35,6 +35,10 @@
#include <pulse/gccmacro.h>
#include <pulsecore/macro.h>
+#ifndef PACKAGE
+#error "Please include config.h before including this file!"
+#endif
+
struct timeval;
/* These resource limits are pretty new on Linux, let's define them
@@ -193,4 +197,13 @@ pa_bool_t pa_in_system_mode(void);
char *pa_machine_id(void);
char *pa_uname_string(void);
+
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+pa_bool_t pa_in_valgrind(void);
+#else
+static inline pa_bool_t pa_in_valgrind(void) {
+ return FALSE;
+}
+#endif
+
#endif
commit 9b00664295d8dd1c4d1ee118fed3308af93723e0
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 4 00:13:05 2008 +0200
instead of checking for directly use new function pa_in_valgrind()
diff --git a/src/daemon/caps.c b/src/daemon/caps.c
index f7b6658..25a09fd 100644
--- a/src/daemon/caps.c
+++ b/src/daemon/caps.c
@@ -112,9 +112,9 @@ void pa_drop_caps(void) {
#ifndef __OPTIMIZE__
/* Valgrind doesn't not know set_caps, so we bypass it here -- but
- * only in development builts.*/
+ * only in development builds.*/
- if (getenv("VALGRIND") && !pa_have_caps())
+ if (pa_in_valgrind() && !pa_have_caps())
return;
#endif
commit 3c193520ee59703b9e4453db0bff8f9c6b8a06c2
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 4 00:13:29 2008 +0200
show valgrind status on startup
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 53f5d19..fad635f 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -793,6 +793,8 @@ int main(int argc, char *argv[]) {
pa_log_debug(_("Compiled with Valgrind support: no"));
#endif
+ pa_log_debug(_("Running in valgrind mode: %s"), pa_yes_no(pa_in_valgrind()));
+
#ifdef __OPTIMIZE__
pa_log_debug(_("Optimized build: yes"));
#else
commit 82c46f223823e8359ee2b788a83eac0ab82c912a
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 4 00:14:02 2008 +0200
do not cleanup staticly allocated memory unless we are in valgrind mode
diff --git a/src/pulsecore/flist.h b/src/pulsecore/flist.h
index 2d8422f..512dd35 100644
--- a/src/pulsecore/flist.h
+++ b/src/pulsecore/flist.h
@@ -26,6 +26,7 @@
#include <pulse/gccmacro.h>
#include <pulsecore/once.h>
+#include <pulsecore/core-util.h>
/* A multiple-reader multipler-write lock-free free list implementation */
@@ -56,6 +57,8 @@ void* pa_flist_pop(pa_flist*l);
} \
static void name##_flist_destructor(void) PA_GCC_DESTRUCTOR; \
static void name##_flist_destructor(void) { \
+ if (!pa_in_valgrind()) \
+ return; \
if (name##_flist.flist) \
pa_flist_free(name##_flist.flist, (free_cb)); \
} \
diff --git a/src/pulsecore/log.c b/src/pulsecore/log.c
index d731808..b1de696 100644
--- a/src/pulsecore/log.c
+++ b/src/pulsecore/log.c
@@ -85,6 +85,9 @@ void pa_log_set_ident(const char *p) {
/* To make valgrind shut up. */
static void ident_destructor(void) PA_GCC_DESTRUCTOR;
static void ident_destructor(void) {
+ if (!pa_in_valgrind())
+ return;
+
pa_xfree(log_ident);
pa_xfree(log_ident_local);
}
diff --git a/src/pulsecore/thread.h b/src/pulsecore/thread.h
index 87e850d..eabe9ba 100644
--- a/src/pulsecore/thread.h
+++ b/src/pulsecore/thread.h
@@ -25,6 +25,7 @@
#include <pulse/def.h>
#include <pulsecore/once.h>
+#include <pulsecore/core-util.h>
#ifndef PACKAGE
#error "Please include config.h before including this file!"
@@ -69,6 +70,8 @@ void *pa_tls_set(pa_tls *t, void *userdata);
static void name##_tls_destructor(void) PA_GCC_DESTRUCTOR; \
static void name##_tls_destructor(void) { \
static void (*_free_cb)(void*) = free_cb; \
+ if (!pa_in_valgrind()) \
+ return; \
if (!name##_tls.tls) \
return; \
if (_free_cb) { \
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list