I have found an annoying though hard-to-reproduce problem.
When I run Unicode.rexx I end up with the 1GB of memory on my sam440flex being fully utilized (I boot to workbench with ~200MB in use to start and can NOT run anything else when running this script...).
Am I hitting some hidden behaviour or something that is not being triggered?
as with ~800MB of free physical memory and no swap partitions at all, I end up with less than 20MB free when the script is run on it's own.
If any of the developers can please confirm that the following commandline is able to complete and is not using an excessive amount of memory for the 2K of ARexx code linked.
Code: Select all
RX Unicode.rexx CJK-Unified-Ideographs 4E00 A000
Code: Select all
/*
\\ Unicode.rexx
//
\\ Generate a Unicode Catalog Fragment based on a Given CodePoint to start and a range-limit to terminate.
*/
Options Results
Parse Arg CatFname rb rh Vector
Range=X2D(rh)-X2D(rb)
Echo 'Section (From=U'||rb||'/To=U'||rh||'/Range='||Range||') is ['||CatFname||']'||Vector||' '
CDFP=CatFname||'.cd'
If ~Open(CDFH,CDFP,WRITE) Then Do
Echo 'Failed to Open Catalog Description for Writing'
Exit
End
CTFP=CatFname||'.ct'
If ~Open(CTFH,CTFP,WRITE) Then Do
Echo 'Failed to Open Catalog Translation for Writing'
Exit
End
Do c=X2D(rb) while c<X2D(rh)
Select
When c<X2D('80') Then cx=D2C(c);
When c<X2D('800') Then If Length(D2C(c))=1 Then Do
cx=B2C('110000'||SubStr(C2B(D2C(c)),1,2))||B2C('10'||SubStr(C2B(D2C(c)),3,6));
End;Else If Length(D2C(c))=2 Then Do
cx=B2C('110'||SubStr(C2B(SubStr(D2C(c),1,1)),6,3)||SubStr(C2B(SubStr(D2C(c),2,1)),1,2))||B2C('10'||SubStr(C2B(SubStr(D2C(c),2,1)),3,6))
End;
When c<X2D('10000') Then Do
cx=B2C('1110'||SubStr(C2B(SubStr(D2C(c),1,1)),1,4))||B2C('10'||SubStr(C2B(SubStr(D2C(c),1,1)),5,4)||SubStr(C2B(SubStr(D2C(c),2,1)),1,2))||B2C('10'||SubStr(C2B(SubStr(D2C(c),2,1)),3,6))
End;
When c<X2D('200000') Then If Length(D2C(c))=4 Then Do
cx=B2C('11110'||SubStr(C2B(SubStr(D2C(c),1,1)),6,3)))||B2C('10'||SubStr(C2B(SubStr(D2C(c),2,1)),1,6))||B2C('10'||SubStr(C2B(SubStr(D2C(c),2,1)),7,2)||SubStr(C2B(SubStr(D2C(c),3,1)),1,4))||B2C('10'||SubStr(C2B(SubStr(D2C(c),3,1)),5,4)||SubStr(C2B(SubStr(D2C(c),4,1)),1,2))||B2C('10'||SubStr(C2B(SubStr(D2C(c),4,1)),3,6))
End;Else If Length(D2C(c))=3 Then Do
cx=B2C('11110'||SubStr(C2B(SubStr(D2C(c),1,1)),4,3))||B2C('10'||SubStr(C2B(SubStr(D2C(c),1,1)),7,2)||SubStr(C2B(SubStr(D2C(c),2,1)),1,4))||B2C('10'||SubStr(C2B(SubStr(D2C(c),2,1)),5,4)||SubStr(C2B(SubStr(D2C(c),3,1)),1,2))||B2C('10'||SubStr(C2B(SubStr(D2C(c),3,1)),3,6))
End;
/*
When c<X2D('4000000') Then Do
End;
*/
Otherwise Exit();
End;
WriteLn(CDFH,'MSG_U'||C2X(D2C(c))||' ( '||cx||' / '||Length(cx)||' / 128 )'||'0A'x||'U='||C2X(cx)||'0A'x||';;');
WriteLn(CTFH,'MSG_U'||C2X(D2C(c))||'0A'x||'U['||cx||']'||'0A'x||';;');
End