summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/event.c4
-rw-r--r--lib/mempool.c4
-rw-r--r--lib/resource.c5
3 files changed, 3 insertions, 10 deletions
diff --git a/lib/event.c b/lib/event.c
index 55a9c48..d556cd0 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -63,10 +63,6 @@ event *
ev_new(pool *p)
{
event *e = ralloc(p, &ev_class);
-
- e->hook = NULL;
- e->data = NULL;
- e->n.next = NULL;
return e;
}
diff --git a/lib/mempool.c b/lib/mempool.c
index e6f277b..03a6e6b 100644
--- a/lib/mempool.c
+++ b/lib/mempool.c
@@ -64,13 +64,9 @@ linpool
*lp_new(pool *p, unsigned blk)
{
linpool *m = ralloc(p, &lp_class);
- m->ptr = m->end = NULL;
- m->first = m->current = NULL;
m->plast = &m->first;
- m->first_large = NULL;
m->chunk_size = blk;
m->threshold = 3*blk/4;
- m->total = m->total_large = 0;
return m;
}
diff --git a/lib/resource.c b/lib/resource.c
index 8f91450..a4d8751 100644
--- a/lib/resource.c
+++ b/lib/resource.c
@@ -183,13 +183,14 @@ rdump(void *res)
*
* This function is called by the resource classes to create a new
* resource of the specified class and link it to the given pool.
- * Size of the resource structure is taken from the @size field
- * of the &resclass.
+ * Allocated memory is zeroed. Size of the resource structure is taken
+ * from the @size field of the &resclass.
*/
void *
ralloc(pool *p, struct resclass *c)
{
resource *r = xmalloc(c->size);
+ bzero(r, c->size);
r->class = c;
add_tail(&p->inside, &r->n);