Mercurial > ~mikael > mcabber > hg
diff mcabber/libjabber/pool.c @ 414:ec86d759ed54
Trailing whitespace cleanup
No real change.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Tue, 30 Aug 2005 22:26:19 +0200 |
parents | bf3d6e241714 |
children | c3ae9251c197 |
line wrap: on
line diff
--- a/mcabber/libjabber/pool.c Tue Aug 30 21:25:16 2005 +0200 +++ b/mcabber/libjabber/pool.c Tue Aug 30 22:26:19 2005 +0200 @@ -15,26 +15,24 @@ * * Jabber * Copyright (C) 1998-1999 The Jabber Team http://jabber.org/ - * + * * 2/27/00:3am, random plans by jer - * + * * ok based on gprof, we really need some innovation here... my thoughs are this: - * + * * most things are strings, so have a string-based true-blue garbage collector * one big global hash containing all the strings created by any pstrdup, returning const char * * a refcount on each string block * when a pool is freed, it moves down the refcount * garbage collector collects pools on the free stack, and runs through the hash for unused strings * j_strcmp can check for == (if they are both from a pstrdup) - * + * * let's see... this would change: * pstrdup: do a hash lookup, success=return, fail=pmalloc & hash put - * pool_free: - * - * - * - * - * + * pool_free: + * + * + * */ #include "libxode.h" @@ -190,7 +188,7 @@ if (result != NULL) memset(result, c, size); return result; -} +} /* easy safety utility (for creating blank mem for structs, etc) */ void *pmalloco(pool p, int size) @@ -198,7 +196,7 @@ void *block = pmalloc(p, size); memset(block, 0, size); return block; -} +} /* XXX efficient: move this to const char * and then loop throug the existing heaps to see if src is within a block in this pool */ char *pstrdup(pool p, const char *src)