Embperl
view release on metacpan or search on metacpan
abort();
exit(1);
}
free_blk = free_blk->h.next;
}
}
#else
#define chk_on_blk_list(_x, _y)
#endif
/* Free a chain of blocks --- must be called with alarms blocked. */
static void free_blocks(union block_hdr *blok)
{
#ifdef ALLOC_USE_MALLOC
union block_hdr *next;
for (; blok; blok = next) {
next = blok->h.next;
free(blok);
}
++num_free_blocks_calls;
num_blocks_freed += num_blocks;
#endif
ep_release_mutex(alloc_mutex);
#endif
}
/* Get a new block, from our own free list if possible, from the system
* if necessary. Must be called with alarms blocked.
*/
static union block_hdr *new_block(int min_size)
{
union block_hdr **lastptr = &block_freelist;
union block_hdr *blok = block_freelist;
/* First, see if we have anything of the required size
* on the free list...
*/
#ifdef EPSPRINTF
/* ep_psprintf is implemented by writing directly into the current
* block of the pool, starting right at first_avail. If there's
* insufficient room, then a new block is allocated and the earlier
* output is copied over. The new block isn't linked into the pool
* until all the output is done.
*
* Note that this is completely safe because nothing else can
* allocate in this tMemPool while ep_psprintf is running. alarms are
* blocked, and the only thing outside of alloc.c that's invoked
* is ep_vformatter -- which was purposefully written to be
* self-contained with no callouts.
*/
struct psprintf_data {
ep_vformatter_buff vbuff;
#ifdef ALLOC_USE_MALLOC
char *base;
#else
union block_hdr *blok;
( run in 0.832 second using v1.01-cache-2.11-cpan-49f99fa48dc )