X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fadt%2Fpdeq.c;h=cc168460e4558ebc179b7f1ab32a5d7860f0ac4f;hb=a6888dd0c74a74aa5ec89d4542e402bda7cd61cb;hp=fe4eb45d109a89c87a39347e652a34c24a8ef3f3;hpb=1a3b7d363474ab544c13093a2f0b578718d37c7a;p=libfirm diff --git a/ir/adt/pdeq.c b/ir/adt/pdeq.c index fe4eb45d1..cc168460e 100644 --- a/ir/adt/pdeq.c +++ b/ir/adt/pdeq.c @@ -22,7 +22,6 @@ * @brief double ended queue of generic pointers. * @author Christian von Roques * @date 1999 by getting from fiasco - * @version $Id$ */ #include "config.h" @@ -74,9 +73,8 @@ struct pdeq { /** * cache of unused, pdeq blocks to speed up new_pdeq and del_pdeq. - * +1 for compilers that can't grok empty arrays */ -static pdeq *pdeq_block_cache[TUNE_NSAVED_PDEQS+1]; +static pdeq *pdeq_block_cache[TUNE_NSAVED_PDEQS]; /** * Number of pdeqs in pdeq_store. @@ -108,7 +106,7 @@ static inline void free_pdeq_block (pdeq *p) static inline pdeq *alloc_pdeq_block (void) { pdeq *p; - if (TUNE_NSAVED_PDEQS && pdeqs_cached) { + if (pdeqs_cached > 0) { p = pdeq_block_cache[--pdeqs_cached]; } else { p = (pdeq*) xmalloc(PREF_MALLOC_SIZE); @@ -116,34 +114,6 @@ static inline pdeq *alloc_pdeq_block (void) return p; } - -#ifndef NDEBUG -/** - * Verify a double ended list, assert if failure. - * - * @param dq The list to verify. - */ -void _pdeq_vrfy(pdeq *dq) -{ - pdeq *q; - - assert ( dq - && (dq->magic == PDEQ_MAGIC1) - && (dq->l_end && dq->r_end)); - q = dq->l_end; - while (q) { - assert ( ((q == dq) || (q->magic == PDEQ_MAGIC2)) - && ((q == dq->l_end) ^ (q->l != NULL)) - && ((q == dq->r_end) ^ (q->r != NULL)) - && (!q->l || (q == q->l->r)) - && (q->n <= NDATA) - && ((q == dq->l_end) || (q == dq->r_end) || (q->n == NDATA)) - && (q->p < NDATA)); - q = q->r; - } -} -#endif - /* Creates a new double ended pointer list. */ pdeq *new_pdeq(void) { @@ -186,7 +156,6 @@ void del_pdeq(pdeq *dq) qq = q->r; free_pdeq_block(q); } while ((q = qq)); - } /* Checks if a list is empty. */