Jabberd14-1.6.0/jabberd/lib/pool.c/_pool_new

Last-modified: 2007-03-05 (月) 20:50:22

このページを編集する際は,編集に関する方針に従ってください.

概要

* make an empty pool
*
* Use the macro pool_new() instead of a direct call to this function. The
* macro will create the parameters for you.

引数

デバッグ用の引数
* @param zone the file in which the pool_new macro is called
* @param line the line in the file in which the pool_new macro is called
* @return the new allocated memory pool

実装

pool _pool_new(char *zone, int line)
{

   int malloc_tries = 0;

#ifdef

   int old__pool__total;

#endif

   pool p = _retried__malloc(sizeof(_pool));
   p->cleanup = NULL;
   p->heap = NULL;
   p->size = 0;

#ifdef

   p->lsize = -1;
   p->zone[0] = '\0';
   strcat(p->zone,zone);
   snprintf(p->zone, sizeof(p->zone), "%s:%i", zone, line);
   snprintf(p->name, sizeof(p->name), "%X", p);
   if(pool__disturbed == NULL)
   {
       pool__disturbed = (xht)1; /* reentrancy flag! */
	old__pool__total = pool__total; /* we won't be able to free this xhash */
       pool__disturbed = xhash_new(POOL_NUM);
	pool__total = old__pool__total;
   }
   if(pool__disturbed != (xht)1)
       xhash_put(pool__disturbed,p->name,p);

#endif

   return p;

}

呼出元

#related: relatedプラグインは廃止されました。