[pulseaudio-commits] r2290 - /branches/glitch-free/src/pulsecore/memblock.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Apr 21 17:52:32 PDT 2008


Author: lennart
Date: Tue Apr 22 02:52:31 2008
New Revision: 2290

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2290&root=pulseaudio&view=rev
Log:
properly initialize memblock->is_silence for imported memory blocks; make is_silence and read_only a bit field

Modified:
    branches/glitch-free/src/pulsecore/memblock.c

Modified: branches/glitch-free/src/pulsecore/memblock.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/memblock.c?rev=2290&root=pulseaudio&r1=2289&r2=2290&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/memblock.c (original)
+++ branches/glitch-free/src/pulsecore/memblock.c Tue Apr 22 02:52:31 2008
@@ -59,7 +59,7 @@
     pa_mempool *pool;
 
     pa_memblock_type_t type;
-    pa_bool_t read_only, is_silence;
+    pa_bool_t read_only:1, is_silence:1;
 
     pa_atomic_ptr_t data;
     size_t length;
@@ -226,8 +226,7 @@
     PA_REFCNT_INIT(b);
     b->pool = p;
     b->type = PA_MEMBLOCK_APPENDED;
-    b->read_only = FALSE;
-    b->is_silence = FALSE;
+    b->read_only = b->is_silence = FALSE;
     pa_atomic_ptr_store(&b->data, (uint8_t*) b + PA_ALIGN(sizeof(pa_memblock)));
     b->length = length;
     pa_atomic_store(&b->n_acquired, 0);
@@ -331,8 +330,7 @@
 
     PA_REFCNT_INIT(b);
     b->pool = p;
-    b->read_only = FALSE;
-    b->is_silence = FALSE;
+    b->read_only = b->is_silence = FALSE;
     b->length = length;
     pa_atomic_store(&b->n_acquired, 0);
     pa_atomic_store(&b->please_signal, 0);
@@ -598,7 +596,7 @@
             pa_atomic_ptr_store(&b->data, new_data);
 
             b->type = PA_MEMBLOCK_POOL_EXTERNAL;
-            b->read_only = 0;
+            b->read_only = FALSE;
 
             goto finish;
         }
@@ -609,7 +607,7 @@
     pa_atomic_ptr_store(&b->data, pa_xmemdup(pa_atomic_ptr_load(&b->data), b->length));
 
     b->type = PA_MEMBLOCK_USER;
-    b->read_only = 0;
+    b->read_only = FALSE;
 
 finish:
     pa_atomic_inc(&b->pool->stat.n_allocated_by_type[b->type]);
@@ -905,7 +903,8 @@
     PA_REFCNT_INIT(b);
     b->pool = i->pool;
     b->type = PA_MEMBLOCK_IMPORTED;
-    b->read_only = 1;
+    b->read_only = TRUE;
+    b->is_silence = FALSE;
     pa_atomic_ptr_store(&b->data, (uint8_t*) seg->memory.ptr + offset);
     b->length = size;
     pa_atomic_store(&b->n_acquired, 0);




More information about the pulseaudio-commits mailing list