src/lib/mem_pool.c
POOLMEM *sm_get_memory(const char *fname, int lineno, int32_t size)
{
   struct abufhead *buf;
   int pool = 0;

   if ((buf = (struct abufhead *)sm_malloc(fname, lineno, size+HEAD_SIZE)) == NULL) {
      Emsg1(M_ABORT, 0, _("Out of memory requesting %d bytes\n"), size);
   }
   buf->ablen = size;
   buf->pool = pool;
   buf->next = NULL;
   P(mutex);
   pool_ctl[pool].in_use++;
   if (pool_ctl[pool].in_use > pool_ctl[pool].max_used)
      pool_ctl[pool].max_used = pool_ctl[pool].in_use;
   V(mutex);
   return (POOLMEM *)(((char *)buf)+HEAD_SIZE);
}
/* Get nonpool memory of size requested */
Get nonpool memory of size requested
Get nonpool memory of size requested
POOLMEM *sm_get_memory(const char *fname, int lineno, int32_t size)
{
   struct abufhead *buf;
   int pool = 0;
   if ((buf = (struct abufhead *)sm_malloc(fname, lineno, size+HEAD_SIZE)) == NULL) {
      Emsg1(M_ABORT, 0, _("Out of memory requesting %d bytes\n"), size);
   }
   buf->ablen = size;
   buf->pool = pool;
   buf->next = NULL;
   P(mutex);
   pool_ctl[pool].in_use++;
   if (pool_ctl[pool].in_use > pool_ctl[pool].max_used)
      pool_ctl[pool].max_used = pool_ctl[pool].in_use;
   V(mutex);
   return (POOLMEM *)(((char *)buf)+HEAD_SIZE);
}
POOLMEM * sm_get_memory ( const char * fname , int lineno , int32_t size ) { struct abufhead * buf ; int pool = 0 ; if ( ( buf = ( struct abufhead * ) sm_malloc ( fname , lineno , size + HEAD_SIZE ) ) == NULL ) { Emsg1 ( M_ABORT , 0 , _ ( " \n " ) , size ) ; } buf -> ablen = size ; buf -> pool = pool ; buf -> next = NULL ; P ( mutex ) ; pool_ctl [ pool ] . in_use ++ ; if ( pool_ctl [ pool ] . in_use > pool_ctl [ pool ] . max_used ) pool_ctl [ pool ] . max_used = pool_ctl [ pool ] . in_use ; V ( mutex ) ; return ( POOLMEM * ) ( ( ( char * ) buf ) + HEAD_SIZE ) ; }
Get nonpool memory of size requested
Get nonpool memory of size requested