Exemplo n.º 1
0
void list_append(list_t *l, uint64_t v)
{
  list_node_t *n = MallocNode(sizeof(list_node_t));
  n->value = v;
  n->next  = NULL;

  if (l->first)
    {
      l->last->next = n;
      l->last = n;
    }
  else
    {
      l->first = n;
      l->last = n;
    }
}
Exemplo n.º 2
0
// Allow to malloc a pointercontainer pointer and also allocate a node structure.
PointerContainer* MallocPNode()
{
PointerContainer* ans = malloc(sizeof(PointerContainer));
	ans = (PointerContainer* ) ValidateMem( (uint64_t) ans);
	// check if the pointerContainer have no 1 on the LSB - if so halt and retunr NULL
	if (ans != FALSE)
	{
		uint64_t ptrAddr = (uint64_t) MallocNode();
		// if the 
		if (ptrAddr == FALSE)
			ans = FALSE;
		else
		{
			ans->ptr = ptrAddr; //18.Oct.2008 - #DEF#20 : (Dotan.H) 
			ans->ptrDel.del = 0;
		}
	}
	 
	return ans; 
}