]> mj.ucw.cz Git - libucw.git/blobdiff - lib/mempool.h
Fixed parsing of bin/config output (by TomHol in rel-3-6-1).
[libucw.git] / lib / mempool.h
index 8d964e4d30f174e60b94ab538fa40c12f3d0560e..255e5389fd8431d7974fe32af8046eb261dbc9a1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *     UCW Library -- Memory Pools
  *
 /*
  *     UCW Library -- Memory Pools
  *
- *     (c) 1997--2004 Martin Mares <mj@ucw.cz>
+ *     (c) 1997--2005 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
@@ -29,7 +29,7 @@ void *mp_alloc_zero(struct mempool *, uns);
 
 static inline void *mp_alloc_fast(struct mempool *p, uns l)
 {
 
 static inline void *mp_alloc_fast(struct mempool *p, uns l)
 {
-  byte *f = (void *) (((uns) p->free + POOL_ALIGN - 1) & ~(POOL_ALIGN - 1));
+  byte *f = (void *) (((addr_int_t) p->free + POOL_ALIGN - 1) & ~(addr_int_t)(POOL_ALIGN - 1));
   byte *ee = f + l;
   if (ee > p->last)
     return mp_alloc(p, l);
   byte *ee = f + l;
   if (ee > p->last)
     return mp_alloc(p, l);
@@ -60,7 +60,7 @@ mp_end_string(struct mempool *p, void *stop)
   p->free = stop;
 }
 
   p->free = stop;
 }
 
-/* pool-str.c */
+/* mempool-str.c */
 
 char *mp_strdup(struct mempool *, char *);
 char *mp_multicat(struct mempool *, ...);
 
 char *mp_strdup(struct mempool *, char *);
 char *mp_multicat(struct mempool *, ...);
@@ -70,4 +70,9 @@ mp_strcat(struct mempool *mp, char *x, char *y)
   return mp_multicat(mp, x, y, NULL);
 }
 
   return mp_multicat(mp, x, y, NULL);
 }
 
+/* mempool-fmt.c */
+
+char *mp_printf(struct mempool *p, char *fmt, ...) FORMAT_CHECK(printf,2,3);
+char *mp_vprintf(struct mempool *p, char *fmt, va_list args);
+
 #endif
 #endif