/* #define TRACECALLARGS */
#ifdef TRACECALLARGS
-static char nomallocmem[16777216];
-static char *nomalloctop = nomallocmem + 16777216;
-static char *nomallocptr = nomallocmem;
+static char *nomallocmem;
+static char *nomalloctop;
+static char *nomallocptr;
static void *lit_checked_alloc (int length)
{
void *m;
+ if (!nomallocmem) {
+ nomallocmem = malloc(16777216);
+ nomalloctop = nomallocmem + 16777216;
+ nomallocptr = nomallocmem;
+ }
+
nomallocptr = (void*) ALIGN ((long) nomallocptr, ALIGNSIZE);
m = nomallocptr;
#define CODEMMAP
+#ifdef USE_BOEHM
+/* Uncollectable memory which can contain references */
+#define GCNEW(type,num) heap_alloc_uncollectable(sizeof(type) * (num))
+#endif
+
#define ALIGN(pos,size) ( ( ((pos)+(size)-1) / (size))*(size) )
#define PADDING(pos,size) ( ALIGN((pos),(size)) - (pos) )
#define OFFSET(s,el) ( (int) ( (size_t) &( ((s*)0) -> el ) ) )
/* #define TRACECALLARGS */
#ifdef TRACECALLARGS
-static char nomallocmem[16777216];
-static char *nomalloctop = nomallocmem + 16777216;
-static char *nomallocptr = nomallocmem;
+static char *nomallocmem;
+static char *nomalloctop;
+static char *nomallocptr;
static void *lit_checked_alloc (int length)
{
void *m;
+ if (!nomallocmem) {
+ nomallocmem = malloc(16777216);
+ nomalloctop = nomallocmem + 16777216;
+ nomallocptr = nomallocmem;
+ }
+
nomallocptr = (void*) ALIGN ((long) nomallocptr, ALIGNSIZE);
m = nomallocptr;
#define CODEMMAP
+#ifdef USE_BOEHM
+/* Uncollectable memory which can contain references */
+#define GCNEW(type,num) heap_alloc_uncollectable(sizeof(type) * (num))
+#endif
+
#define ALIGN(pos,size) ( ( ((pos)+(size)-1) / (size))*(size) )
#define PADDING(pos,size) ( ALIGN((pos),(size)) - (pos) )
#define OFFSET(s,el) ( (int) ( (size_t) &( ((s*)0) -> el ) ) )