Browse Source

adapted to new semantics of the EHEAP error: no longer fatal

ceriel 36 years ago
parent
commit
b2275303a2
4 changed files with 7 additions and 5 deletions
  1. 2 2
      doc/em/dspace.nr
  2. 2 1
      doc/em/em.i
  3. 2 1
      doc/em/int/em.p
  4. 1 1
      doc/em/traps.nr

+ 2 - 2
doc/em/dspace.nr

@@ -357,9 +357,9 @@ If it is smaller, then the heap shrinks.
 HP may never point below its original value.
 All words between the current HP and the original HP
 are allocated to the heap.
-The heap may not grow into a part of memory that is already allocated
-for the stack.
+The heap may not grow into a part of memory that is already allocated.
 When this is attempted, the STR instruction will cause a trap to occur.
+In this case, HP retains its old value.
 .P
 The only way to address the heap is indirectly.
 Whenever an object is allocated by increasing HP,

+ 2 - 1
doc/em/em.i

@@ -205,7 +205,8 @@ begin if (a<sp) or (a mod wsize<>0) then trap(ESTACK); lb:=a end;
 
 procedure newhp(a:adr);
 begin if (a>sp) or (a>maxdata+1) or (a mod wsize<>0)
-      then trap(EHEAP); hp:=a
+      then trap(EHEAP)
+      else hp:=a
 end;
 
 function argc(a:double):sword;

+ 2 - 1
doc/em/int/em.p

@@ -245,7 +245,8 @@ begin if (a<sp) or (a mod wsize<>0) then trap(ESTACK); lb:=a end;
 
 procedure newhp(a:adr);
 begin if (a>sp) or (a>maxdata+1) or (a mod wsize<>0)
-      then trap(EHEAP); hp:=a
+      then trap(EHEAP)
+      else hp:=a
 end;
 
 function argc(a:double):sword;

+ 1 - 1
doc/em/traps.nr

@@ -96,7 +96,7 @@ n l l.
 9@EFUND@Undefined float
 10@ECONV@Conversion error
 16*@ESTACK@Stack overflow
-17*@EHEAP@Heap overflow
+17@EHEAP@Heap overflow
 18*@EILLINS@Illegal instruction
 19*@EODDZ@Illegal size argument
 20*@ECASE@Case error