types for constants (optional)
[libfirm] / ir / adt / pdeq.c
index 9fab93a..691c460 100644 (file)
@@ -1,5 +1,15 @@
-/* Pdeq --- double ended queue of generic pointers.
-   Copyright (C) 1995, 1996 Christian von Roques */
+/*
+ * Project:     libFIRM
+ * File name:   ir/adt/pdeq.c
+ * Purpose:     Pdeq --- double ended queue of generic pointers.
+ * Author:      Christian von Roques
+ * Modified by:
+ * Created:     1999 by getting from fiasco
+ * CVS-ID:      $Id$
+ * Copyright:   (c) 1995, 1996 Christian von Roques
+ * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ */
+
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 # ifdef HAVE_STRING_H
 #  include <string.h>
 # endif
-#include "tune.h"
+
 #include "cookies.h"
 #include "debug.h"
-#include "malloc.h"
 #include "pdeq.h"
+#include "xmalloc.h"
+
+
+/** Size of pdeq block cache */
+#define TUNE_NSAVED_PDEQS 16
+
+#ifndef INLINE
+#ifdef USE_GCC_INLINE
+#define INLINE inline
+#else
+#define INLINE
+#endif
+#endif
 
 /* # of data items in block */
 #define NDATA ((int)((PREF_MALLOC_SIZE - offsetof (pdeq, data)) / sizeof (void *)))
@@ -45,7 +68,7 @@ pdeq *pdeq_block_cache[TUNE_NSAVED_PDEQS+1];
 unsigned pdeqs_cached;         /* # pdeqs in pdeq_store */
 
 
-static inline void
+static INLINE void
 free_pdeq_block (pdeq *p)
 {
 #ifndef NDEBUG
@@ -61,7 +84,7 @@ free_pdeq_block (pdeq *p)
 }
 
 
-static inline pdeq *
+static INLINE pdeq *
 alloc_pdeq_block (void)
 {
   pdeq *p;