Exemplo n.º 1
0
void Z_BFree(struct block_memory_alloc_s *pzone, void* p) {
  register bmalpool_t **pool = (bmalpool_t**)&(pzone->firstpool);

  while (*pool != NULL) {
    int n = iselem(*pool, pzone->size, p);

    if (n >= 0) {
#ifdef SIMPLECHECKS
      if ((*pool)->used[n] == unused_block)
        I_Error("Z_BFree: Refree in zone %s", pzone->desc);
#endif
      (*pool)->used[n] = unused_block;
      if (memchr(((*pool)->used), used_block, (*pool)->blocks) == NULL) {
        // Block is all unused, can be freed
        bmalpool_t *oldpool = *pool;
        *pool = (*pool)->nextpool;
        Z_Free(oldpool);
      }
      return;
    }
    else {
      pool = &((*pool)->nextpool);
    }
  }
  I_Error("Z_BFree: Free not in zone %s", pzone->desc);
}
Exemplo n.º 2
0
Arquivo: ledc.c Projeto: sanikoyes/iup
static void param_elem( Tparam* p[], int n, int rep )
{
  switch (p[n-1]->tag)
  {
    case ELEM_PARAM:
      if (p[n-1]->data.elem->elemidx == IMAGE ||
          p[n-1]->data.elem->elemidx == IMAGERGB ||
          p[n-1]->data.elem->elemidx == IMAGERGBA )
        error( "%s is not a valid child", p[n-1]->data.elem->elemname ); 
      break;
    case NAME_PARAM:
      if (!iselem(p[n-1]->data.name))
        warning( "undeclared control '%s' (argument #%d)", p[n-1]->data.name, n );
      else if (!rep)
        checkused( p[n-1]->data.name );
      break;
    case STRING_PARAM:
      error( "control expected (argument #%d)", n );
      break;
  }
}