summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-12-19 08:18:07 +0000
committerMartin Pool <mbp@samba.org>2001-12-19 08:18:07 +0000
commit085d62b38cc9869dbab1356c105520ab2347939d (patch)
treed409c5d9a351ae3097ae6f15c01cb0a42079e016 /source3/lib
parentec781f8e842c6fbe7ce2aab1d71716bccf26f690 (diff)
downloadsamba-085d62b38cc9869dbab1356c105520ab2347939d.tar.gz
samba-085d62b38cc9869dbab1356c105520ab2347939d.tar.bz2
samba-085d62b38cc9869dbab1356c105520ab2347939d.zip
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)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/talloctort.c10
1 files changed, 6 insertions, 4 deletions
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--)