From 085d62b38cc9869dbab1356c105520ab2347939d Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 19 Dec 2001 08:18:07 +0000 Subject: Use less memory, but scribble all over it, just in case there's something wrong with the way it's allocated. (This used to be commit a7b052d991bf39b6f3391f78b95b18ebb8ef596c) --- source3/lib/talloctort.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/talloctort.c b/source3/lib/talloctort.c index f43a4e4f9f..427e7dee70 100644 --- a/source3/lib/talloctort.c +++ b/source3/lib/talloctort.c @@ -35,8 +35,8 @@ int main(void) for (i = 0; i < NCTX; i++) { int j; for (j = 0; j < NOBJ; j++) { - void *p; - size_t size = 1<<(i+j); + char *p; + size_t size = 1<<(i/3+j); p = talloc(ctx[i], size); if (!p) { @@ -45,13 +45,15 @@ int main(void) (double) size); exit(1); } + + memset(p, 'A' + j, size); } } for (i = 0; i < NCTX; i++) { - printf("talloc@%p %-40s %db\n", ctx[i], + printf("talloc@%p %-40s %dkB\n", ctx[i], talloc_pool_name(ctx[i]), - talloc_pool_size(ctx[i])); + talloc_pool_size(ctx[i]) >> 10); } for (i = NCTX - 1; i >= 0; i--) -- cgit