New function to strdup into a mempool.

2000-11-21  Not Zed  <NotZed@HelixCode.com>

        * e-memory.c
        (e_mempool_strdup): New function to strdup into a mempool.

svn path=/trunk/; revision=6630
This commit is contained in:
Not Zed
2000-11-21 14:31:41 +00:00
committed by Michael Zucci
parent 8d9d1e00dd
commit bb09c40e2f
3 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,7 @@
* e-memory.c (e_memchunk_alloc0): New function to allocate a
zero'd out chunk.
(e_mempool_strdup): New function to strdup into a mempool.
2000-11-20 Not Zed <NotZed@HelixCode.com>

View File

@ -427,6 +427,16 @@ void *e_mempool_alloc(MemPool *pool, int size)
}
}
char *e_mempool_strdup(EMemPool *pool, const char *str)
{
char *out;
out = e_mempool_alloc(pool, strlen(str));
strcpy(out, str);
return out;
}
/**
* e_mempool_flush:
* @pool:

View File

@ -46,6 +46,7 @@ typedef enum {
EMemPool *e_mempool_new(int blocksize, int threshold, EMemPoolFlags flags);
void *e_mempool_alloc(EMemPool *pool, int size);
char *e_mempool_strdup(EMemPool *pool, const char *str);
void e_mempool_flush(EMemPool *pool, int freeall);
void e_mempool_destroy(EMemPool *pool);