]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/fb-atomic.c
Mempool: Implemented statistics about allocated bytes from memory pool to application.
[libucw.git] / ucw / fb-atomic.c
index aef0018ac03ddaeca722b5a5594348de96139ada..03f0a65f8c893837305e9d5120e37ebaa57fbd67 100644 (file)
@@ -7,11 +7,11 @@
  *     of the GNU Lesser General Public License.
  */
 
-#include "ucw/lib.h"
-#include "ucw/fastbuf.h"
-#include "ucw/io.h"
-#include "ucw/conf.h"
-#include "ucw/trans.h"
+#include <ucw/lib.h>
+#include <ucw/fastbuf.h>
+#include <ucw/io.h>
+#include <ucw/conf.h>
+#include <ucw/trans.h>
 
 #include <string.h>
 #include <fcntl.h>
@@ -23,7 +23,8 @@ static uns trace;
 
 static struct cf_section fbatomic_config = {
   CF_ITEMS {
-    CF_UNS("Trace", &trace)
+    CF_UNS("Trace", &trace),
+    CF_END
   }
 };
 
@@ -34,6 +35,7 @@ static void CONSTRUCTOR fbatomic_init_config(void)
 
 #endif
 
+#define FB_ATOMIC(f) ((struct fb_atomic *)(f))
 #define TRACE(m...) do { if(trace) msg(L_DEBUG, "FB_ATOMIC: " m); } while(0)
 
 struct fb_atomic_file {
@@ -77,6 +79,7 @@ fbatomic_spout(struct fastbuf *f)
       f->buffer = xrealloc(f->buffer, size);
       f->bufend = f->buffer + size;
       f->bptr = f->buffer + written;
+      f->bstop = f->buffer;
       F->expected_max_bptr = f->bufend - F->slack_size;
     }
   else