update 2024/kurdyukov4

fixed bug and increased input size limit to 4MB
This commit is contained in:
Ilya Kurdyukov authored and GitHub committed 2025-08-05 18:06:22 +07:00
1 parent 0e891d4975
commit 808ddf12e5
2 files changed
+8 -9

No files matched your search

+4 -5
View File
@@ -7,14 +7,13 @@
### Bugs and (Mis)features:
The current status of this entry is:
It is necessary to avoid collisions with C keywords when generating names for variables, for example: if do asm int for EOF.
> **STATUS: known bug - please help us fix**
The original code had a collision with the keywords "asm" and "int", now it is fixed.
For more detailed information see [2024/kurdyukov4 in bugs.html](../../bugs.html#2024_kurdyukov4).
Also, the size of the static buffers has increased from 1MB to 16MB, which should ensure processing of at least 4MB of input. If you want to increase the limit, look for `24` in the source code (this is a power of two, for 8MB of input data you would need `25`, and so on).
In fixing this bug you will come to a better appreciation of how the
code was able to process random data files as large as 64K.
Current code was tested with an input of 1MB.
## To use:
+4 -4
View File
@@ -4,7 +4,7 @@
#define o(x,o)x##o
char X[
1<<16
][4],Z[1<<20],*N= X[1]
][4],Z[1<<24],*N= X[1]
,*P=Z,*H,A[12];char*C(int i,o(u
,nsigned) x){char*B =0,*
D;if((x >>16)|| 0==*
@@ -14,8 +14,8 @@
?c<0 ?45:43 :0,C(0 ,c<0? -c:c
));B =B?a= *N,b= N[1], c=N[2 ],*B
=a+!b -90?a =='z'?65:a+ 1:(b ='z' -b?b
-90? b%64+ 65:97 :(c=- ~c|96 ,65) ,~b%
56%47 ?97: 'j') ,B[1 ]=b, B[2] =c,o
-90? b%64+ 65:97 :(c=c ?'z'- c?-~ c:48
:'a', 65), 'j') ,B[1 ]=b, B[2] =c,o
(prin ,tf) (",%" "s=%s" ,B,A) ,(N= B):A
;;}o( ret, urn) i>0 ?P+=o (spr ,intf
)(P, ",%s" ,B):B ;}int main (){;
@@ -23,7 +23,7 @@
=98; for( printf("#inclu" "de " "<st"
"dio" ".h>" "\nint" " a;i" "nt"
" ma" "in()" "{int" " b="
"-~a") ;i>3&&P- Z+33<1<< 20;C(
"-~a") ;i>3&&P- Z+33<1<< 24;C(
i,a)) for(a=i=0;i<4&&0<=(c= o(get,
char)( ));n++)((char *)&a)[
i++]=c; H=P;C(1