Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
770827fd
Commit
770827fd
authored
Nov 21, 2002
by
John van Groningen
Browse files
give the strictness analyser more memory for large modules,
move some definitions from settings.c+h to sa.c
parent
2fb9d801
Changes
3
Hide whitespace changes
Inline
Side-by-side
backendC/CleanCompilerSources/sa.c
View file @
770827fd
...
...
@@ -55,6 +55,13 @@
#define for_l(v,l,n) for(v=(l);v!=NULL;v=v->n)
#define NR_BLOCKS 200
#define NR_BLOCKS_FOR_ANALYSIS 100
#define BLOCK_SIZE (unsigned long) (16 * KBYTE)
unsigned
long
StrictMemUse
=
NR_BLOCKS
*
BLOCK_SIZE
;
#ifdef CHECK_STACK_OVERFLOW
char
*
min_stack
;
int
stack_source
=
0
;
...
...
@@ -243,8 +250,8 @@ static char *ffree = Null; /* the freezed free position */
static
void
NewBlock
(
void
)
{
if
(
usedblocks
<
n_allocated_blocks
)
usedblocks
++
;
else
if
(
n_allocated_blocks
<
NR_BLOCKS
&&
(
BLOCK_SIZE
*
(
n_allocated_blocks
+
1
)
)
<
StrictMemUse
){
++
usedblocks
;
else
if
(
n_allocated_blocks
<
NR_BLOCKS
&&
(
fblocks
==
0
||
n_allocated_blocks
<
fblocks
+
NR_BLOCKS_FOR_ANALYSIS
)
&&
BLOCK_SIZE
*
(
n_allocated_blocks
+
1
)
<
StrictMemUse
){
if
(
!
(
free_pos
=
(
char
*
)
Alloc
(
BLOCK_SIZE
,
SizeOf
(
char
))))
return
;
...
...
@@ -253,7 +260,7 @@ static void NewBlock (void)
n_allocated_blocks
++
;
usedblocks
++
;
}
else
{
free_pos
=
(
char
*
)
Null
;
free_pos
=
NULL
;
return
;
}
...
...
@@ -356,7 +363,7 @@ static void FreeBlocks (void)
}
}
n_allocated_blocks
=
usedblocks
=
fblocks
=
0
;
n_allocated_blocks
=
usedblocks
=
fblocks
=
0
;
free_pos
=
ffree
=
Null
;
}
...
...
backendC/CleanCompilerSources/settings.c
View file @
770827fd
...
...
@@ -44,8 +44,6 @@ Bool StrictDoEager = True;
Bool
StrictDoVerbose
=
False
;
Bool
StrictDoAnnots
=
True
;
unsigned
long
StrictMemUse
=
NR_BLOCKS
*
BLOCK_SIZE
;
Bool
FunctionMayFailIsError
=
False
;
Bool
NotUsedIsError
=
False
;
Bool
FunctionNotUsedIsError
=
False
;
...
...
backendC/CleanCompilerSources/settings.h
View file @
770827fd
...
...
@@ -31,8 +31,6 @@ extern Bool OptimizeLazyTupleRecursion;
extern
Bool
OptimizeTailCallModuloCons
;
extern
Bool
WriteModificationTimes
;
#define NR_BLOCKS 100
#define BLOCK_SIZE (unsigned long) (16 * KBYTE)
#define StrictDoRelated False
extern
unsigned
StrictDepth
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment