implement newOrNil, changes to stdlib

- newOrNil works like new, but sets the variable to nil
  if the heap allocation failed
- change stdlib to use newOrNil in openfile and openvolumeid
- changes to programs that use openvolumeid
This commit is contained in:
slederer 2025-08-31 23:30:40 +02:00
parent 165517a9c8
commit 14d6de059d
10 changed files with 68 additions and 48 deletions

View file

@ -123,7 +123,8 @@ begin
freeAreaCount := 0;
lastUsed := 0;
openvolumeid(volid);
openvolumeid(volid, error);
(* ignoring theoretically possible out-of-heap-error *)
i := 0;
endSlot := volumeTable[volid].part.dirSize - 1;
@ -308,7 +309,7 @@ begin
writeln('Volume ', volname, ' not found.')
else
begin
openvolumeid(volid);
openvolumeid(volid, error);
endSlot := volumeTable[volid].part.dirSize - 1;
extentSize := volumeTable[volid].part.extentSize;