[pulseaudio-commits] r1831 - in /branches/lennart/src/pulsecore: memblock.c memblock.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun Sep 16 14:57:15 PDT 2007


Author: lennart
Date: Sun Sep 16 23:57:15 2007
New Revision: 1831

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1831&root=pulseaudio&view=rev
Log:
add new API pa_mempool_block_size_max() to query the maximum tile size

Modified:
    branches/lennart/src/pulsecore/memblock.c
    branches/lennart/src/pulsecore/memblock.h

Modified: branches/lennart/src/pulsecore/memblock.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/memblock.c?rev=1831&root=pulseaudio&r1=1830&r2=1831&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/memblock.c (original)
+++ branches/lennart/src/pulsecore/memblock.c Sun Sep 16 23:57:15 2007
@@ -300,7 +300,7 @@
      * take the largest size that fits in one of our slots. */
     
     if (length == (size_t) -1)
-        length = p->block_size - PA_ALIGN(sizeof(struct mempool_slot)) - PA_ALIGN(sizeof(pa_memblock));
+        length = pa_mempool_block_size_max(p);
     
     if (p->block_size - PA_ALIGN(sizeof(struct mempool_slot)) >= PA_ALIGN(sizeof(pa_memblock)) + length) {
 
@@ -720,6 +720,13 @@
     pa_assert(p);
 
     return &p->stat;
+}
+
+/* No lock necessary */
+size_t pa_mempool_block_size_max(pa_mempool *p) {
+    pa_assert(p);
+
+    return p->block_size - PA_ALIGN(sizeof(struct mempool_slot)) - PA_ALIGN(sizeof(pa_memblock));
 }
 
 /* No lock necessary */

Modified: branches/lennart/src/pulsecore/memblock.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/memblock.h?rev=1831&root=pulseaudio&r1=1830&r2=1831&view=diff
==============================================================================
--- branches/lennart/src/pulsecore/memblock.h (original)
+++ branches/lennart/src/pulsecore/memblock.h Sun Sep 16 23:57:15 2007
@@ -122,6 +122,7 @@
 void pa_mempool_vacuum(pa_mempool *p);
 int pa_mempool_get_shm_id(pa_mempool *p, uint32_t *id);
 int pa_mempool_is_shared(pa_mempool *p);
+size_t pa_mempool_block_size_max(pa_mempool *p);
 
 /* For recieving blocks from other nodes */
 pa_memimport* pa_memimport_new(pa_mempool *p, pa_memimport_release_cb_t cb, void *userdata);




More information about the pulseaudio-commits mailing list