From 4f74ff94505fd968c45f0c3ba72b4c62325f211a Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 19 Dec 2001 04:50:10 +0000 Subject: Start adding some debugging features to talloc based on Samba's ancient mem_man.c: Each TALLOC_CTX now has a field to store its purpose, to aid in tracking down memory bloat. A new call talloc_init_named() should be used instead of talloc_init() so that this is set. Added talloc_vasprintf to be called by varargs functions. (This used to be commit 25b97a743573b8c5e0ac886e4bfab581c11b3714) --- source3/include/talloc.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3/include') diff --git a/source3/include/talloc.h b/source3/include/talloc.h index 89c2f82e05..8e20cc028a 100644 --- a/source3/include/talloc.h +++ b/source3/include/talloc.h @@ -5,6 +5,7 @@ Version 3.0 Samba temporary memory allocation functions Copyright (C) Andrew Tridgell 2000 + Copyright (C) 2001 by Martin Pool This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,9 +28,18 @@ struct talloc_chunk { void *ptr; }; + +/** + * talloc allocation pool. All allocated blocks can be freed in one go. + **/ typedef struct { struct talloc_chunk *list; size_t total_alloc_size; + + /** The name recorded for this pool, if any. Should describe + * the purpose for which it was allocated. The string is + * allocated within the pool. **/ + char *name; } TALLOC_CTX; #endif -- cgit