[pulseaudio-commits] r1747 - in /branches/lennart/src/pulsecore: memchunk.c memchunk.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun Sep 2 13:37:56 PDT 2007


Author: lennart
Date: Sun Sep  2 22:37:55 2007
New Revision: 1747

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1747&root=3Dpulseaudio&vi=
ew=3Drev
Log:
add new pa_memchunk_will_need() API, similar to pa_memblock_will_need()

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

Modified: branches/lennart/src/pulsecore/memchunk.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
memchunk.c?rev=3D1747&root=3Dpulseaudio&r1=3D1746&r2=3D1747&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/memchunk.c (original)
+++ branches/lennart/src/pulsecore/memchunk.c Sun Sep  2 22:37:55 2007
@@ -29,8 +29,11 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <string.h>
+#include <errno.h>
 =

 #include <pulse/xmalloc.h>
+#include <pulsecore/macro.h>
+#include <pulsecore/core-util.h>
 =

 #include "memchunk.h"
 =

@@ -72,3 +75,19 @@
 =

     return c;
 }
+
+pa_memchunk *pa_memchunk_will_need(pa_memchunk *c) {
+    void *p;
+
+    pa_assert(c);
+    pa_assert(c->memblock);
+
+    /* A version of pa_memblock_will_need() that works on memchunks
+     * instead of memblocks */
+
+    p =3D (uint8_t*) pa_memblock_acquire(c->memblock) + c->index;
+    pa_will_need(p, c->length);
+    pa_memblock_release(c->memblock);
+
+    return c;
+}

Modified: branches/lennart/src/pulsecore/memchunk.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
memchunk.h?rev=3D1747&root=3Dpulseaudio&r1=3D1746&r2=3D1747&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/memchunk.h (original)
+++ branches/lennart/src/pulsecore/memchunk.h Sun Sep  2 22:37:55 2007
@@ -44,4 +44,7 @@
  * but sets all members to zero. */
 pa_memchunk* pa_memchunk_reset(pa_memchunk *c);
 =

+/* Map a memory chunk back into memory if it was swapped out */
+pa_memchunk *pa_memchunk_will_need(pa_memchunk *c);
+
 #endif




More information about the pulseaudio-commits mailing list