bzero(x, s);
return x;
}
+
+char *
+mp_strdup(struct mempool *p, char *s)
+{
+ uns l = strlen(s) + 1;
+ char *t = mp_alloc_fast_noalign(p, l);
+ memcpy(t, s, l);
+ return t;
+}
/*
* Sherlock Library -- Memory Pools
*
- * (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ * (c) 1997--2004 Martin Mares <mj@ucw.cz>
*
* This software may be freely distributed and used according to the terms
* of the GNU Lesser General Public License.
void mp_flush(struct mempool *);
void *mp_alloc(struct mempool *, uns);
void *mp_alloc_zero(struct mempool *, uns);
+char *mp_strdup(struct mempool *, char *);
static inline void *mp_alloc_fast(struct mempool *p, uns l)
{