Jabberd14-1.6.0/jabberd/lib/xhash.c/_xhash_node_new

Last-modified: 2007-03-05 (月) 22:31:21

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

概要

* insert a new 'node' in the xhash

引数

* @param h the xhash where to insert the new node
* @param index to which index the node should be inserted
* @return the newly created node

実装

xhn _xhash_node_new(xht h, int index) {
    xhn n;
    int i = index % h->prime;
    /* get existing empty one */
    for(n = h->zen[i]; n != NULL; n = n->next)
	 if(n->key == NULL)	/* should not happen anymore, we are now removing unused nodes */
	     return n;
  • 結局メモリプール使って無い。うまく動かないの?そうは見えなかったけどなぁ。
    /* overflowing, new one! */
    n = malloc(sizeof(_xhn));	/* XXX dangerous not to use a memory pool, but current pools don't allow to free memory! */
    bzero(n, sizeof(_xhn));
    n->next = h->zen[i];
    h->zen[i] = n;
    return n;
}

呼出元

Jabberd14-1.6.0/jabberd/lib/xhash.c/xhash_put?

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