Revision 92af6f30 lib/mempool.c

View differences:

lib/mempool.c
73 73
	}
74 74
      else
75 75
	{
76
	  if (m->current && m->current->next)
77
	    /* Still have free chunks from previous incarnation (before lp_flush()) */
78
	    c = m->current->next;
76
	  if (m->current)
77
	    {
78
	      /* Still have free chunks from previous incarnation (before lp_flush()) */
79
	      c = m->current;
80
	      m->current = c->next;
81
	    }
79 82
	  else
80 83
	    {
81 84
	      /* Need to allocate a new chunk */
......
85 88
	      m->plast = &c->next;
86 89
	      c->next = NULL;
87 90
	    }
88
	  m->current = c;
89 91
	  m->ptr = c->data + size;
90 92
	  m->end = c->data + m->chunk_size;
91 93
	}

Also available in: Unified diff