aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-11-21 12:01:10 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-11-21 12:01:10 +0800
commit4639aa999e0776b02651412ab12ded8f0c35669c (patch)
tree55f9e49623a93f9ad3ad6a1a7478b9ad248db96c
parent7ea24b0cb12e396794284da34762c508bce472d8 (diff)
downloadgsoc2013-evolution-4639aa999e0776b02651412ab12ded8f0c35669c.tar.gz
gsoc2013-evolution-4639aa999e0776b02651412ab12ded8f0c35669c.tar.zst
gsoc2013-evolution-4639aa999e0776b02651412ab12ded8f0c35669c.zip
New function to allocate a zero'd out chunk.
2000-11-21 Not Zed <NotZed@HelixCode.com> * e-memory.c (e_memchunk_alloc0): New function to allocate a zero'd out chunk. svn path=/trunk/; revision=6624
-rw-r--r--e-util/ChangeLog5
-rw-r--r--e-util/e-memory.c10
-rw-r--r--e-util/e-memory.h1
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);