* Merged with 0da121c758b9.
[cacao.git] / src / mm / dumpmemory.h
index 4700df566ae03659bcebae02bff1b70c7b8345f3..f51977799533768759635be856b7c2a2657c6826 100644 (file)
@@ -65,7 +65,7 @@ typedef struct dump_allocation_t dump_allocation_t;
 struct dump_allocation_t {
        dump_allocation_t *next;
        void              *mem;
-       int32_t            useddumpsize;
+       int32_t            used;
        int32_t            size;
 };
 #endif
@@ -74,9 +74,9 @@ struct dump_allocation_t {
 /* dumpinfo *******************************************************************/
 
 struct dumpinfo_t {
-       dumpblock_t       *currentdumpblock;        /* the current top-most block */
-       int32_t            allocateddumpsize;     /* allocated bytes in this area */
-       int32_t            useddumpsize;          /* used bytes in this dump area */
+       dumpblock_t       *block;                   /* the current top-most block */
+       int32_t            allocated;             /* allocated bytes in this area */
+       int32_t            used;                  /* used bytes in this dump area */
 #if defined(ENABLE_MEMCHECK)
        dump_allocation_t *allocations;       /* list of allocations in this area */
 #endif
@@ -85,17 +85,20 @@ struct dumpinfo_t {
 
 /* convenience macros *********************************************************/
 
-#define DNEW(type)            ((type *) dump_alloc(sizeof(type)))
-#define DMNEW(type,num)       ((type *) dump_alloc(sizeof(type) * (num)))
-#define DMREALLOC(ptr,type,num1,num2) dump_realloc((ptr), sizeof(type) * (num1), \
+#define DMARKER               dumpmarker = dumpmemory_marker()
+#define DRELEASE              dumpmemory_release(dumpmarker)
+
+#define DNEW(type)            ((type *) dumpmemory_get(sizeof(type)))
+#define DMNEW(type,num)       ((type *) dumpmemory_get(sizeof(type) * (num)))
+#define DMREALLOC(ptr,type,num1,num2) dumpmemory_realloc((ptr), sizeof(type) * (num1), \
                                                           sizeof(type) * (num2))
 
 /* function prototypes ********************************************************/
 
-void    *dump_alloc(int32_t size);
-void    *dump_realloc(void *src, int32_t len1, int32_t len2);
-int32_t  dump_size(void);
-void     dump_release(int32_t size);
+void    *dumpmemory_get(size_t size);
+void    *dumpmemory_realloc(void *src, int32_t len1, int32_t len2);
+int32_t  dumpmemory_marker(void);
+void     dumpmemory_release(int32_t size);
 
 #endif /* _DUMPMEMORY_H */