]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
Save a byte of memory
authorLennart Poettering <lennart@poettering.net>
Wed, 3 Sep 2008 00:59:49 +0000 (02:59 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 3 Sep 2008 18:25:38 +0000 (20:25 +0200)
Since we only need a single char, we should allocate only a single char,
instead of a string of two bytes.

Woah! We're saving memory, baby!

pulse/pulse.c

index f91d0e71503d380115d1ba657fbfe39329402afe..7bf0c7a09a1b3f7733b2aea454d3a7edf571790a 100644 (file)
@@ -272,9 +272,10 @@ int pulse_connect(snd_pulse_t * p, const char *server)
 
 void pulse_poll_activate(snd_pulse_t * p)
 {
+       static const char x = 'x';
        assert(p);
 
-       write(p->thread_fd, "a", 1);
+       write(p->thread_fd, &x, 1);
 }
 
 void pulse_poll_deactivate(snd_pulse_t * p)