diff options
author | David Sommerseth <dazo@users.sourceforge.net> | 2009-09-07 22:53:21 +0200 |
---|---|---|
committer | David Sommerseth <dazo@users.sourceforge.net> | 2009-09-07 22:53:21 +0200 |
commit | 55f75cd2678f249c5503109798a69fbbc01936af (patch) | |
tree | cc6ed3e16a661ad3d2f68888dd94672580aec6e7 /common/eurephia_nullsafe.c | |
parent | 2e1851802188515f8edeed8eb3f753cf69e348d9 (diff) | |
download | eurephia-55f75cd2678f249c5503109798a69fbbc01936af.tar.gz eurephia-55f75cd2678f249c5503109798a69fbbc01936af.tar.xz eurephia-55f75cd2678f249c5503109798a69fbbc01936af.zip |
Fixed comments to malloc_nullsafe() and free_nullsafe()
Diffstat (limited to 'common/eurephia_nullsafe.c')
-rw-r--r-- | common/eurephia_nullsafe.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/common/eurephia_nullsafe.c b/common/eurephia_nullsafe.c index bcca178..bd78d6b 100644 --- a/common/eurephia_nullsafe.c +++ b/common/eurephia_nullsafe.c @@ -39,7 +39,10 @@ #include <eurephia_log.h> /** - * Internal function, called via the malloc_nullsafe() macro. + * Internal function, should be called via the malloc_nullsafe() macro. + * This replaces the use of malloc() and memset(). This function uses calloc + * internally, which results in the memory region being zero'd by the kernel + * on memory allocation. * * @param ctx eurephiaCTX, used for logging * @param sz size of the memory region being allocated @@ -69,6 +72,17 @@ void *__malloc_nullsafe(eurephiaCTX *ctx, size_t sz, const char *file, int line) return buf; } + +/** + * Internal function for freeing memory. Also does some logging of the freeing if debug level + * enabled and log level high enough. Should be called via the free_nullsafe() macro. + * + * @param ctx eurephiaCTX (for logging only) + * @param ptr Pointer to the memory region to be freed + * @param file debug info, which file is doing this call + * @param line debug info, which line in the file + * + */ void inline __free_nullsafe(eurephiaCTX *ctx, void *ptr, const char *file, int line) { if( ptr == NULL ) { return; |