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 $
*/
*******************************************************************************/
#if !defined(ENABLE_THREADS)
-static dumpinfo _no_threads_dumpinfo;
+static dumpinfo_t _no_threads_umpinfo;
#endif
#if defined(ENABLE_THREADS)
#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. */
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. */
#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->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;
#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;
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 $
*/
/* 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"
#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"
*/
-
-#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)))