pool.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. /** BEGIN COPYRIGHT BLOCK
  2. * This Program is free software; you can redistribute it and/or modify it under
  3. * the terms of the GNU General Public License as published by the Free Software
  4. * Foundation; version 2 of the License.
  5. *
  6. * This Program is distributed in the hope that it will be useful, but WITHOUT
  7. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  8. * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  9. *
  10. * You should have received a copy of the GNU General Public License along with
  11. * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
  12. * Place, Suite 330, Boston, MA 02111-1307 USA.
  13. *
  14. * In addition, as a special exception, Red Hat, Inc. gives You the additional
  15. * right to link the code of this Program with code not covered under the GNU
  16. * General Public License ("Non-GPL Code") and to distribute linked combinations
  17. * including the two, subject to the limitations in this paragraph. Non-GPL Code
  18. * permitted under this exception must only link to the code of this Program
  19. * through those well defined interfaces identified in the file named EXCEPTION
  20. * found in the source code files (the "Approved Interfaces"). The files of
  21. * Non-GPL Code may instantiate templates or use macros or inline functions from
  22. * the Approved Interfaces without causing the resulting work to be covered by
  23. * the GNU General Public License. Only Red Hat, Inc. may make changes or
  24. * additions to the list of Approved Interfaces. You must obey the GNU General
  25. * Public License in all respects for all of the Program code and other code used
  26. * in conjunction with the Program except the Non-GPL Code covered by this
  27. * exception. If you modify this file, you may extend this exception to your
  28. * version of the file, but you are not obligated to do so. If you do not wish to
  29. * provide this exception without modification, you must delete this exception
  30. * statement from your version and license this file solely under the GPL without
  31. * exception.
  32. *
  33. *
  34. * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
  35. * Copyright (C) 2005 Red Hat, Inc.
  36. * All rights reserved.
  37. * END COPYRIGHT BLOCK **/
  38. #ifdef HAVE_CONFIG_H
  39. # include <config.h>
  40. #endif
  41. /*
  42. * Generic pool handling routines.
  43. *
  44. * Hopefully these reduce the number of malloc/free calls.
  45. *
  46. *
  47. * Thread warning:
  48. * This implementation is thread safe. However, simultaneous
  49. * mallocs/frees to the same "pool" are not safe. If you wish to
  50. * use this module across multiple threads, you should define
  51. * POOL_LOCKING which will make the malloc pools safe.
  52. *
  53. * Mike Belshe
  54. * 11-20-95
  55. *
  56. */
  57. #include "netsite.h"
  58. #include "base/systems.h"
  59. #include "base/systhr.h"
  60. #ifdef MALLOC_POOLS
  61. #include "base/pool.h"
  62. #include "base/ereport.h"
  63. #include "base/util.h"
  64. #include "base/crit.h"
  65. #include "base/dbtbase.h"
  66. #ifdef DEBUG
  67. #define POOL_ZERO_DEBUG
  68. #endif
  69. #undef POOL_LOCKING
  70. #define BLOCK_SIZE (32 * 1024)
  71. #define MAX_FREELIST_SIZE (BLOCK_SIZE * 32)
  72. /* WORD SIZE 8 sets us up for 8 byte alignment. */
  73. #define WORD_SIZE 8
  74. #undef ALIGN
  75. #define ALIGN(x) ( (x + WORD_SIZE-1) & (~(WORD_SIZE-1)) )
  76. /* block_t
  77. * When the user allocates space, a BLOCK_SIZE (or larger) block is created in
  78. * the pool. This block is used until all the space is eaten within it.
  79. * When all the space is gone, a new block is created.
  80. *
  81. */
  82. typedef struct block_t {
  83. char *data; /* the real alloc'd space */
  84. char *start; /* first free byte in block */
  85. char *end; /* ptr to end of block */
  86. struct block_t *next; /* ptr to next block */
  87. } block_t;
  88. /* pool_t
  89. * A pool is a collection of blocks. The blocks consist of multiple
  90. * allocations of memory, but a single allocation cannot be freed by
  91. * itself. Once the memory is allocated it is allocated until the
  92. * entire pool is freed.
  93. */
  94. typedef struct pool_t {
  95. #ifdef DEBUG_CACHES
  96. time_t time_created;
  97. #endif
  98. #ifdef POOL_LOCKING
  99. CRITICAL lock; /* lock for modifying the pool */
  100. #endif
  101. block_t *curr_block; /* current block being used */
  102. block_t *used_blocks; /* blocks that are all used up */
  103. long size; /* size of memory in pool */
  104. struct pool_t *next; /* known_pools list */
  105. } pool_t;
  106. /* known_pools
  107. * Primarily for debugging, keep a list of all active malloc pools.
  108. */
  109. static pool_t *known_pools = NULL;
  110. static CRITICAL known_pools_lock = NULL;
  111. static unsigned long pool_blocks_created = 0;
  112. static unsigned long pool_blocks_freed = 0;
  113. /* freelist
  114. * Internally we maintain a list of free blocks which we try to pull from
  115. * whenever possible. This list will never have more than MAX_FREELIST_SIZE
  116. * bytes within it.
  117. */
  118. static CRITICAL freelist_lock = NULL;
  119. static block_t *freelist = NULL;
  120. static unsigned long freelist_size = 0;
  121. static unsigned long freelist_max = MAX_FREELIST_SIZE;
  122. static int pool_disable = 0;
  123. int
  124. pool_internal_init()
  125. {
  126. if (pool_disable == 0) {
  127. if (known_pools_lock == NULL) {
  128. known_pools_lock = crit_init();
  129. freelist_lock = crit_init();
  130. }
  131. }
  132. return 0;
  133. }
  134. static block_t *
  135. _create_block(int size)
  136. {
  137. block_t *newblock = NULL;
  138. long bytes = ALIGN(size);
  139. block_t *free_ptr,
  140. *last_free_ptr = NULL;
  141. /* check freelist for large enough block first */
  142. crit_enter(freelist_lock);
  143. free_ptr = freelist;
  144. while(free_ptr && ((free_ptr->end - free_ptr->data) < bytes)) {
  145. last_free_ptr = free_ptr;
  146. free_ptr = free_ptr->next;
  147. }
  148. if (free_ptr) {
  149. newblock = free_ptr;
  150. if (last_free_ptr)
  151. last_free_ptr->next = free_ptr->next;
  152. else
  153. freelist = free_ptr->next;
  154. freelist_size -= (newblock->end - newblock->data);
  155. crit_exit(freelist_lock);
  156. bytes = free_ptr->end - free_ptr->data;
  157. }
  158. else {
  159. pool_blocks_created++;
  160. crit_exit(freelist_lock);
  161. if (((newblock = (block_t *)PERM_MALLOC(sizeof(block_t))) == NULL) ||
  162. ((newblock->data = (char *)PERM_MALLOC(bytes)) == NULL)) {
  163. ereport(LOG_CATASTROPHE, XP_GetAdminStr(DBT_poolCreateBlockOutOfMemory_));
  164. if (newblock)
  165. PERM_FREE(newblock);
  166. return NULL;
  167. }
  168. }
  169. newblock->start = newblock->data;
  170. newblock->end = newblock->data + bytes;
  171. newblock->next = NULL;
  172. return newblock;
  173. }
  174. /* Caller must hold lock for the pool */
  175. static void
  176. _free_block(block_t *block)
  177. {
  178. #ifdef POOL_ZERO_DEBUG
  179. memset(block->data, 0xa, block->end-block->data);
  180. #endif /* POOL_ZERO_DEBUG */
  181. if ((unsigned long)(freelist_size + block->end - block->data) > freelist_max) {
  182. /* Just have to delete the whole block! */
  183. crit_enter(freelist_lock);
  184. pool_blocks_freed++;
  185. crit_exit(freelist_lock);
  186. PERM_FREE(block->data);
  187. #ifdef POOL_ZERO_DEBUG
  188. memset(block, 0xa, sizeof(block));
  189. #endif /* POOL_ZERO_DEBUG */
  190. PERM_FREE(block);
  191. return;
  192. }
  193. crit_enter(freelist_lock);
  194. freelist_size += (block->end - block->data);
  195. block->start = block->data;
  196. block->next = freelist;
  197. freelist = block;
  198. crit_exit(freelist_lock);
  199. }
  200. /* ptr_in_pool()
  201. * Checks to see if the given pointer is in the given pool.
  202. * If true, returns a ptr to the block_t containing the ptr;
  203. * otherwise returns NULL
  204. */
  205. block_t *
  206. _ptr_in_pool(pool_t *pool, void *ptr)
  207. {
  208. block_t *block_ptr = NULL;
  209. /* try to find a block which contains this ptr */
  210. if ( ((char *)ptr < (char *)pool->curr_block->end) &&
  211. ((char *)ptr >= (char *)pool->curr_block->data) )
  212. block_ptr = pool->curr_block;
  213. else
  214. for( block_ptr = pool->used_blocks;
  215. block_ptr &&
  216. (((char *)ptr >= (char *)block_ptr->end) &&
  217. ((char *)ptr < (char *)block_ptr->data));
  218. block_ptr = block_ptr->next);
  219. return block_ptr;
  220. }
  221. NSAPI_PUBLIC pool_handle_t *
  222. pool_create()
  223. {
  224. pool_t *newpool;
  225. if (pool_disable)
  226. return NULL;
  227. newpool = (pool_t *)PERM_MALLOC(sizeof(pool_t));
  228. if (newpool) {
  229. /* Have to initialize now, as pools get created sometimes
  230. * before pool_init can be called...
  231. */
  232. if (known_pools_lock == NULL) {
  233. known_pools_lock = crit_init();
  234. freelist_lock = crit_init();
  235. }
  236. if ( (newpool->curr_block =_create_block(BLOCK_SIZE)) == NULL) {
  237. ereport(LOG_CATASTROPHE, XP_GetAdminStr(DBT_poolCreateOutOfMemory_));
  238. PERM_FREE(newpool);
  239. return NULL;
  240. }
  241. newpool->used_blocks = NULL;
  242. newpool->size = 0;
  243. newpool->next = NULL;
  244. #ifdef POOL_LOCKING
  245. newpool->lock = crit_init();
  246. #endif
  247. #ifdef DEBUG_CACHES
  248. newpool->time_created = time(NULL);
  249. #endif
  250. /* Add to known pools list */
  251. crit_enter(known_pools_lock);
  252. newpool->next = known_pools;
  253. known_pools = newpool;
  254. crit_exit(known_pools_lock);
  255. }
  256. else
  257. ereport(LOG_CATASTROPHE, XP_GetAdminStr(DBT_poolCreateOutOfMemory_1));
  258. return (pool_handle_t *)newpool;
  259. }
  260. NSAPI_PUBLIC void
  261. pool_destroy(pool_handle_t *pool_handle)
  262. {
  263. pool_t *pool = (pool_t *)pool_handle;
  264. block_t *tmp_blk;
  265. pool_t *last, *search;
  266. if (pool_disable)
  267. return;
  268. crit_enter(known_pools_lock);
  269. #ifdef POOL_LOCKING
  270. crit_enter(pool->lock);
  271. #endif
  272. if (pool->curr_block)
  273. _free_block(pool->curr_block);
  274. while(pool->used_blocks) {
  275. tmp_blk = pool->used_blocks;
  276. pool->used_blocks = pool->used_blocks->next;
  277. _free_block(tmp_blk);
  278. }
  279. /* Remove from the known pools list */
  280. for (last = NULL, search = known_pools; search;
  281. last = search, search = search->next)
  282. if (search == pool)
  283. break;
  284. if (search) {
  285. if(last)
  286. last->next = search->next;
  287. else
  288. known_pools = search->next;
  289. }
  290. #ifdef POOL_LOCKING
  291. crit_exit(pool->lock);
  292. crit_terminate(pool->lock);
  293. #endif
  294. crit_exit(known_pools_lock);
  295. #ifdef POOL_ZERO_DEBUG
  296. memset(pool, 0xa, sizeof(pool));
  297. #endif /* POOL_ZERO_DEBUG */
  298. PERM_FREE(pool);
  299. return;
  300. }
  301. NSAPI_PUBLIC void *
  302. pool_malloc(pool_handle_t *pool_handle, size_t size)
  303. {
  304. pool_t *pool = (pool_t *)pool_handle;
  305. long reqsize, blocksize;
  306. char *ptr;
  307. if (pool == NULL || pool_disable) {
  308. return PERM_MALLOC(size);
  309. }
  310. #ifdef DEBUG
  311. if (size == 0)
  312. return NULL;
  313. #endif
  314. #ifdef POOL_LOCKING
  315. crit_enter(pool->lock);
  316. #endif
  317. reqsize = ALIGN(size);
  318. ptr = pool->curr_block->start;
  319. pool->curr_block->start += reqsize;
  320. /* does this fit into the last allocated block? */
  321. if (pool->curr_block->start > pool->curr_block->end) {
  322. /* Did not fit; time to allocate a new block */
  323. pool->curr_block->start -= reqsize; /* keep structs in tact */
  324. pool->curr_block->next = pool->used_blocks;
  325. pool->used_blocks = pool->curr_block;
  326. /* Allocate a chunk of memory which is a multiple of BLOCK_SIZE
  327. * bytes
  328. */
  329. blocksize = ( (size + BLOCK_SIZE-1) / BLOCK_SIZE ) * BLOCK_SIZE;
  330. if ( (pool->curr_block = _create_block(blocksize)) == NULL) {
  331. ereport(LOG_CATASTROPHE, XP_GetAdminStr(DBT_poolMallocOutOfMemory_));
  332. #ifdef POOL_LOCKING
  333. crit_exit(pool->lock);
  334. #endif
  335. return NULL;
  336. }
  337. ptr = pool->curr_block->start;
  338. reqsize = ALIGN(size);
  339. pool->curr_block->start += reqsize;
  340. }
  341. pool->size += reqsize;
  342. #ifdef POOL_LOCKING
  343. crit_exit(pool->lock);
  344. #endif
  345. return ptr;
  346. }
  347. void _pool_free_error()
  348. {
  349. ereport(LOG_WARN, XP_GetAdminStr(DBT_freeUsedWherePermFreeShouldHaveB_));
  350. return;
  351. }
  352. NSAPI_PUBLIC void
  353. pool_free(pool_handle_t *pool_handle, void *ptr)
  354. {
  355. if (pool_handle == NULL || pool_disable) {
  356. PERM_FREE(ptr);
  357. return;
  358. }
  359. #ifdef DEBUG
  360. /* Just to be nice, check to see if the ptr was allocated in a pool.
  361. * If not, issue a warning and do a REAL free just to make sure that
  362. * we don't leak memory.
  363. */
  364. if ( !_ptr_in_pool((pool_t *)pool_handle, ptr) ) {
  365. _pool_free_error();
  366. PERM_FREE(ptr);
  367. }
  368. #endif
  369. return;
  370. }
  371. NSAPI_PUBLIC void *
  372. pool_calloc(pool_handle_t *pool_handle, size_t nelem, size_t elsize)
  373. {
  374. void *ptr;
  375. if (pool_handle == NULL || pool_disable)
  376. return PERM_CALLOC(elsize * nelem);
  377. ptr = pool_malloc(pool_handle, elsize * nelem);
  378. if (ptr)
  379. memset(ptr, 0, elsize * nelem);
  380. return ptr;
  381. }
  382. NSAPI_PUBLIC void *
  383. pool_realloc(pool_handle_t *pool_handle, void *ptr, size_t size)
  384. {
  385. pool_t *pool = (pool_t *)pool_handle;
  386. void *newptr;
  387. block_t *block_ptr;
  388. size_t oldsize;
  389. if (pool_handle == NULL || pool_disable)
  390. return PERM_REALLOC(ptr, size);
  391. if ( (newptr = pool_malloc(pool_handle, size)) == NULL)
  392. return NULL;
  393. /* With our structure we don't know exactly where the end
  394. * of the original block is. But we do know an upper bound
  395. * which is a valid ptr. Search the outstanding blocks
  396. * for the block which contains this ptr, and copy...
  397. */
  398. #ifdef POOL_LOCKING
  399. crit_enter(pool->lock);
  400. #endif
  401. if ( !(block_ptr = _ptr_in_pool(pool, ptr)) ) {
  402. /* User is trying to realloc nonmalloc'd space! */
  403. return newptr;
  404. }
  405. oldsize = block_ptr->end - (char *)ptr ;
  406. if (oldsize > size)
  407. oldsize = size;
  408. memmove((char *)newptr, (char *)ptr, oldsize);
  409. #ifdef POOL_LOCKING
  410. crit_exit(pool->lock);
  411. #endif
  412. return newptr;
  413. }
  414. NSAPI_PUBLIC char *
  415. pool_strdup(pool_handle_t *pool_handle, const char *orig_str)
  416. {
  417. char *new_str;
  418. int len = strlen(orig_str);
  419. if (pool_handle == NULL || pool_disable)
  420. return PERM_STRDUP(orig_str);
  421. new_str = (char *)pool_malloc(pool_handle, len+1);
  422. if (new_str)
  423. memcpy(new_str, orig_str, len+1);
  424. return new_str;
  425. }
  426. NSAPI_PUBLIC long
  427. pool_space(pool_handle_t *pool_handle)
  428. {
  429. pool_t *pool = (pool_t *)pool_handle;
  430. return pool->size;
  431. }
  432. NSAPI_PUBLIC int pool_enabled()
  433. {
  434. #ifndef THREAD_ANY
  435. /* we don't have USE_NSPR defined so systhread_getdata is undef'ed */
  436. return 0;
  437. #else
  438. if (pool_disable || (getThreadMallocKey() == -1) )
  439. return 0;
  440. if (!systhread_getdata(getThreadMallocKey()))
  441. return 0;
  442. return 1;
  443. #endif
  444. }
  445. /* pool_service_debug()
  446. * NSAPI service routine to print state information about the existing
  447. * pools. Hopefully useful in debugging.
  448. *
  449. */
  450. #define MAX_DEBUG_LINE 1024
  451. #ifdef DEBUG_CACHES /* XXXrobm causes entanglement in install and admserv cgis */
  452. NSAPI_PUBLIC int
  453. pool_service_debug(pblock *pb, Session *sn, Request *rq)
  454. {
  455. char tmp_buf[MAX_DEBUG_LINE];
  456. char cbuf[DEF_CTIMEBUF];
  457. int len;
  458. pool_t *pool_ptr;
  459. block_t *block_ptr;
  460. int pool_cnt, block_cnt;
  461. param_free(pblock_remove("content-type", rq->srvhdrs));
  462. pblock_nvinsert("content-type", "text/html", rq->srvhdrs);
  463. protocol_status(sn, rq, PROTOCOL_OK, NULL);
  464. protocol_start_response(sn, rq);
  465. len = util_sprintf(tmp_buf, "<H2>Memory pool status report</H2>\n");
  466. net_write(sn->csd, tmp_buf, len);
  467. len = util_sprintf(tmp_buf, "Note: The 0 block in each pool is \
  468. the currently used block <P>\n");
  469. net_write(sn->csd, tmp_buf, len);
  470. len = util_sprintf(tmp_buf, "Freelist size: %d/%d<P>", freelist_size,
  471. freelist_max);
  472. net_write(sn->csd, tmp_buf, len);
  473. len = util_sprintf(tmp_buf, "Pool disabled: %d<P>", pool_disable);
  474. net_write(sn->csd, tmp_buf, len);
  475. len = util_sprintf(tmp_buf, "Blocks created: %d<P> Blocks freed: %d",
  476. pool_blocks_created, pool_blocks_freed);
  477. net_write(sn->csd, tmp_buf, len);
  478. /* Create an HTML table */
  479. len = util_sprintf(tmp_buf, "<UL><TABLE BORDER=4>\n");
  480. net_write(sn->csd, tmp_buf, len);
  481. len = util_sprintf(tmp_buf, "<TH>Pool #</TH>\n");
  482. net_write(sn->csd, tmp_buf, len);
  483. len = util_sprintf(tmp_buf, "<TH>Pool size #</TH>\n");
  484. net_write(sn->csd, tmp_buf, len);
  485. #ifdef DEBUG_CACHES
  486. len = util_sprintf(tmp_buf, "<TH>Time Created</TH>\n");
  487. net_write(sn->csd, tmp_buf, len);
  488. #endif
  489. len = util_sprintf(tmp_buf, "<TH>Blocks</TH>\n");
  490. net_write(sn->csd, tmp_buf, len);
  491. crit_enter(known_pools_lock);
  492. for (pool_cnt = 0, pool_ptr = known_pools; pool_ptr;
  493. pool_ptr = pool_ptr->next, pool_cnt++) {
  494. #ifdef POOL_LOCKING
  495. crit_enter(pool_ptr->lock);
  496. #endif
  497. len = util_snprintf(tmp_buf, MAX_DEBUG_LINE,
  498. #ifndef DEBUG_CACHES
  499. "<tr align=right> <td>%d</td> <td>%d</td> <td> <TABLE BORDER=2> <TH>Block #</TH><TH>data</TH><TH>curr size</TH> <TH>max size</TH>\n",
  500. #else
  501. "<tr align=right> <td>%d</td> <td>%d</td> <td>%s</td> <td> <TABLE BORDER=2> <TH>Block #</TH><TH>data</TH><TH>curr size</TH> <TH>max size</TH>\n",
  502. #endif
  503. pool_cnt, pool_space((pool_handle_t *)pool_ptr)
  504. #ifdef DEBUG_CACHES
  505. , util_ctime(&(pool_ptr->time_created), cbuf, DEF_CTIMEBUF));
  506. #else
  507. );
  508. #endif
  509. net_write(sn->csd, tmp_buf, len);
  510. /* Print the first block */
  511. len = util_snprintf(tmp_buf, MAX_DEBUG_LINE, "\
  512. <tr align=right> \
  513. <td>%d</td> \
  514. <td>%d</td> \
  515. <td>%d</td> \
  516. <td>%d</td> \
  517. </tr>\n",
  518. 0, pool_ptr->curr_block->data,
  519. pool_ptr->curr_block->start -pool_ptr->curr_block->data,
  520. pool_ptr->curr_block->end - pool_ptr->curr_block->data);
  521. net_write(sn->csd, tmp_buf, len);
  522. for (block_cnt = 1, block_ptr = pool_ptr->used_blocks; block_ptr;
  523. block_ptr = block_ptr->next, block_cnt++) {
  524. len = util_snprintf(tmp_buf, MAX_DEBUG_LINE, "\
  525. <tr align=right> \
  526. <td>%d</td> \
  527. <td>%d</td> \
  528. <td>%d</td> \
  529. <td>%d</td> \
  530. </tr>\n",
  531. block_cnt, block_ptr->data,
  532. block_ptr->start - block_ptr->data,
  533. block_ptr->end - block_ptr->data);
  534. net_write(sn->csd, tmp_buf, len);
  535. }
  536. #ifdef POOL_LOCKING
  537. crit_exit(pool_ptr->lock);
  538. #endif
  539. len = util_snprintf(tmp_buf, MAX_DEBUG_LINE, "</TABLE></TD></TR>");
  540. net_write(sn->csd, tmp_buf, len);
  541. }
  542. crit_exit(known_pools_lock);
  543. len = util_sprintf(tmp_buf, "</TABLE></UL>\n");
  544. net_write(sn->csd, tmp_buf, len);
  545. return REQ_PROCEED;
  546. }
  547. #endif /* 0 */
  548. #endif /* MALLOC_POOLS */