]> mj.ucw.cz Git - libucw.git/blobdiff - lib/pools.h
Added very simple functions for emulating a fastbuf stream over a static
[libucw.git] / lib / pools.h
index aef1e63e4437f8a1f9838532cea0a12bbae700aa..a055ef2623763f2da93ca77632ca60d168df9c7d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     Sherlock Library -- Memory Pools
  *
- *     (c) 1997--2001 Martin Mares <mj@ucw.cz>
+ *     (c) 1997--2003 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
@@ -47,4 +47,17 @@ static inline void *mp_alloc_fast_noalign(struct mempool *p, uns l)
   return f;
 }
 
+static inline void *
+mp_start_string(struct mempool *p, uns l)
+{
+  ASSERT(l <= p->chunk_size);
+  return mp_alloc(p, l);
+}
+
+static inline void
+mp_end_string(struct mempool *p, void *stop)
+{
+  p->free = stop;
+}
+
 #endif