2 Unix SMB/CIFS implementation.
3 Samba temporary memory allocation functions -- torturer
4 Copyright (C) 2001 by Martin Pool <mbp@samba.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #error SAMBA4 clean up
22 #error this file should be (re)moved
23 #error and all unused stuff should go
33 TALLOC_CTX *ctx[NCTX];
35 for (i = 0; i < NCTX; i++) {
36 ctx[i] = talloc_init("torture(%d)", i);
39 for (i = 0; i < NCTX; i++) {
41 for (j = 0; j < NOBJ; j++) {
43 size_t size = 1<<(i/3+j);
45 p = talloc(ctx[i], size);
48 "failed to talloc %.0f bytes\n",
53 memset(p, 'A' + j, size);
57 for (i = 0; i < NCTX; i++) {
58 printf("talloc@%p %-40s %dkB\n", ctx[i],
59 talloc_pool_name(ctx[i]),
60 talloc_pool_size(ctx[i]) >> 10);
63 printf("%s", talloc_describe_all(ctx[0]));
65 for (i = NCTX - 1; i >= 0; i--)
66 talloc_destroy(ctx[i]);