* src/mm/memory.h (dumpblock): Postfixed with _t and moved before
authortwisti <none@none>
Thu, 19 Oct 2006 09:25:41 +0000 (09:25 +0000)
committertwisti <none@none>
Thu, 19 Oct 2006 09:25:41 +0000 (09:25 +0000)
internal includes, as we have some problems with threadobject.
(dumpinfo): Likewise.
* src/mm/memory.c: Postfixed dumpblock and dumpinfo with _t.

src/mm/memory.c
src/mm/memory.h

index 4900572658392557bc29d198b086d66cffd5c4f3..d852d78f8b1b947292a63706e3501fb391322292 100644 (file)
@@ -29,7 +29,7 @@
    Changes: Christian Thalinger
                        Edwin Steiner
 
-   $Id: memory.c 5170 2006-07-25 12:33:52Z twisti $
+   $Id: memory.c 5803 2006-10-19 09:25:41Z twisti $
 
 */
 
@@ -81,7 +81,7 @@
 *******************************************************************************/
 
 #if !defined(ENABLE_THREADS)
-static dumpinfo _no_threads_dumpinfo;
+static dumpinfo_t _no_threads_umpinfo;
 #endif
 
 #if defined(ENABLE_THREADS)
@@ -353,8 +353,8 @@ void *dump_alloc(s4 size)
 
 #else /* !defined(DISABLE_DUMP) */
 
-       void     *m;
-       dumpinfo *di;
+       void       *m;
+       dumpinfo_t *di;
 
        /* If no threads are used, the dumpinfo structure is a static structure   */
        /* defined at the top of this file.                                       */
@@ -367,12 +367,12 @@ void *dump_alloc(s4 size)
        size = ALIGN(size, ALIGNSIZE);
 
        if (di->useddumpsize + size > di->allocateddumpsize) {
-               dumpblock *newdumpblock;
+               dumpblock_t *newdumpblock;
                s4         newdumpblocksize;
 
                /* allocate a new dumplist structure */
 
-               newdumpblock = memory_checked_alloc(sizeof(dumpblock));
+               newdumpblock = memory_checked_alloc(sizeof(dumpblock_t));
 
                /* If requested size is greater than the default, make the new dump   */
                /* block as big as the size requested. Else use the default size.     */
@@ -480,7 +480,7 @@ void dump_release(s4 size)
 
 #else /* !defined(DISABLE_DUMP) */
 
-       dumpinfo *di;
+       dumpinfo_t *di;
 
        /* If no threads are used, the dumpinfo structure is a static structure   */
        /* defined at the top of this file.                                       */
@@ -495,7 +495,7 @@ void dump_release(s4 size)
        di->useddumpsize = size;
 
        while (di->currentdumpblock && di->allocateddumpsize - di->currentdumpblock->size >= di->useddumpsize) {
-               dumpblock *tmp = di->currentdumpblock;
+               dumpblock_t *tmp = di->currentdumpblock;
 
                di->allocateddumpsize -= tmp->size;
                di->currentdumpblock = tmp->prev;
@@ -532,14 +532,14 @@ s4 dump_size(void)
 
 #else /* !defined(DISABLE_DUMP) */
 
-       dumpinfo *di;
+       dumpinfo_t *di;
 
        /* If no threads are used, the dumpinfo structure is a static structure   */
        /* defined at the top of this file.                                       */
 
        di = DUMPINFO;
 
-       if (!di)
+       if (di == NULL)
                return 0;
 
        return di->useddumpsize;
index 51260073ccc6d36ce09d65d5a448c005d8b43125..e4b9ad029cb910e2c944dade54700fb9a1d565b8 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes: Christian Thalinger
 
-   $Id: memory.h 5158 2006-07-18 14:05:43Z twisti $
+   $Id: memory.h 5803 2006-10-19 09:25:41Z twisti $
 
 */
 
@@ -38,8 +38,8 @@
 
 /* forward typedefs ***********************************************************/
 
-typedef struct dumpblock dumpblock;
-typedef struct dumpinfo dumpinfo;
+typedef struct dumpblock_t dumpblock_t;
+typedef struct dumpinfo_t  dumpinfo_t;
 
 #include "config.h"
 
@@ -47,6 +47,34 @@ typedef struct dumpinfo dumpinfo;
 
 #include "vm/types.h"
 
+
+/* ATTENTION: We need to define dumpblock_t and dumpinfo_t before
+   internal includes, as we need dumpinfo_t as nested structure in
+   threadobject. */
+
+/* dumpblock ******************************************************************/
+
+#define DUMPBLOCKSIZE    2 << 13    /* 2 * 8192 bytes */
+#define ALIGNSIZE        8
+
+struct dumpblock_t {
+       dumpblock_t *prev;
+       u1          *dumpmem;
+       s4           size;
+};
+
+
+/* dumpinfo *******************************************************************/
+
+struct dumpinfo_t {
+       dumpblock_t *currentdumpblock;
+       s4           allocateddumpsize;
+       s4           useddumpsize;
+};
+
+
+/* internal includes **********************************************************/
+
 #include "mm/boehm.h"
 
 
@@ -101,29 +129,6 @@ Some more macros:
 
 */
 
-
-#define DUMPBLOCKSIZE    2 << 13    /* 2 * 8192 bytes */
-#define ALIGNSIZE        8
-
-
-/* dumpblock ******************************************************************/
-
-struct dumpblock {
-       dumpblock *prev;
-       u1        *dumpmem;
-       s4         size;
-};
-
-
-/* dumpinfo *******************************************************************/
-
-struct dumpinfo {
-       dumpblock *currentdumpblock;
-       s4         allocateddumpsize;
-       s4         useddumpsize;
-};
-
-
 #define ALIGN(pos,size)       ((((pos) + (size) - 1) / (size)) * (size))
 #define PADDING(pos,size)     (ALIGN((pos),(size)) - (pos))
 #define OFFSET(s,el)          ((s4) ((ptrint) &(((s*) 0)->el)))