a bug of the slab implementation in viengoos?
Da Zheng <[email protected]> Mon, 31 May 2010 21:26:49 +0800
| Newsgroups | gmane.os.hurd.l4 |
|---|---|
| Message-ID | <[email protected]> |
Hello, I recently ported the slab implementation in viengoos to Hurd. It seems that the refcount field of hurd_slab isn't initialized when it is created in grow(). here is the patch to fix it. Best regards, Zheng Da
slab.patch
(text/x-patch, 458 B)
diff --git a/libhurd-slab/slab.c b/libhurd-slab/slab.c
index b6e3f51..f78357c 100644
--- a/libhurd-slab/slab.c
+++ b/libhurd-slab/slab.c
@@ -253,6 +253,7 @@ grow (struct hurd_slab_space *space)
__hurd_slab_nr_pages++;
new_slab = (p + getpagesize () - sizeof (struct hurd_slab));
+ memset (new_slab, 0, sizeof (*new_slab));
/* Calculate the number of objects that the page can hold.
SPACE->size should be adjusted to handle alignment. */