pool.cpp 17 KB

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