[PATCH] Touching ringbuffer buffer

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[PATCH] Touching ringbuffer buffer

Kjetil S. Matheussen

From examples/capture_client.c:

  /* When JACK is running realtime, jack_activate() will have
  * called mlockall() to lock our pages into memory.  But, we
  * still need to touch any newly allocated pages before
  * process() starts using them.  Otherwise, a page fault could
  * create a delay that would force JACK to shut us down. */
  memset(in, 0, in_size);
  memset(rb->buf, 0, rb->size);

Why isn't this done by default in libjack/ringbuffer.c instead? In case
its just a glip, heres the patch. :-)

[kjetil@ttleush jack]$ diff -u libjack/ringbuffer.c.~1.7.~ libjack/ringbuffer.c
--- libjack/ringbuffer.c.~1.7.~ 2004-07-08 10:21:03.000000000 -0700
+++ libjack/ringbuffer.c        2005-11-25 16:23:32.000000000 -0800
@@ -48,6 +48,7 @@
    rb->write_ptr = 0;
    rb->read_ptr = 0;
    rb->buf = malloc (rb->size);
+  memset(rb->buf, 0, rb->size);
    rb->mlocked = 0;

    return rb;


This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
Jackit-devel mailing list
[hidden email]