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:
@ -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>
|
||||
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user