diff options
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 5 | ||||
-rw-r--r-- | e-util/e-memory.c | 10 | ||||
-rw-r--r-- | e-util/e-memory.h | 1 |
3 files changed, 16 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 65cd11ae63..2fbb4631a2 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,8 @@ +2000-11-21 Not Zed <NotZed@HelixCode.com> + + * e-memory.c (e_memchunk_alloc0): New function to allocate a + zero'd out chunk. + 2000-11-20 Not Zed <NotZed@HelixCode.com> * e-memory.[ch]: New routines for fast memory management and diff --git a/e-util/e-memory.c b/e-util/e-memory.c index c3f7bfde15..2a3cd55771 100644 --- a/e-util/e-memory.c +++ b/e-util/e-memory.c @@ -135,6 +135,16 @@ void *e_memchunk_alloc(MemChunk *m) } } +void *e_memchunk_alloc0(EMemChunk *m) +{ + void *mem; + + mem = e_memchunk_alloc(m); + memset(mem, 0, m->atomsize); + + return mem; +} + /** * e_memchunk_free: * @m: diff --git a/e-util/e-memory.h b/e-util/e-memory.h index d0c2a0ee3c..3f1f2f0f4d 100644 --- a/e-util/e-memory.h +++ b/e-util/e-memory.h @@ -28,6 +28,7 @@ typedef struct _EMemChunk EMemChunk; EMemChunk *e_memchunk_new(int atomcount, int atomsize); void *e_memchunk_alloc(EMemChunk *m); +void *e_memchunk_alloc0(EMemChunk *m); void e_memchunk_free(EMemChunk *m, void *mem); void e_memchunk_empty(EMemChunk *m); void e_memchunk_clean(EMemChunk *m); |