Re: Searching for Fastest Way to Input a File

new topic     » goto parent     » topic index » view thread      » older message » newer message
mattlewis said...
jimcbrown said...

I made a mistake here. I took a closer look at the code, and this is what it actually does:

        if (count > MAXINT_DBL) 
	                RTFatal("repetition count must not be more than 1073741823"); 

(from source/be_runtime.c)

Here's how MAXINT_DBL is defined:

#define MAXINT_DBL ((eudouble)MAXINT) 

And here's the actual limit for 32bit:

#define MAXINT       (intptr_t) 0x3FFFFFFFL 

But it's set to this for 64bit:

#define MAXINT       (intptr_t) INT64_C( 0x3FFFFFFFFFFFFFFF ) 

(The last three snippnets are from include/euphoria.h)

So, if the true limit is ever reached, the error message udner 64bits will be wrong. But the limit for 64bit has already been raised.

But if you tried to make a sequence that big, there would be problems, because the actual structure uses an "int" for the sequence length.

Either way, the check is broken - either the sequence length should be promoted to long, or the check should check for the old (32bit) MAXINT value when determining maximum length. The point is, the check for the maximum sequence length and the actual maximum sequence length should match.

If they don't, then it's a serious code freeze overriding bug.

mattlewis said...

Honestly, I don't see any compelling reason to raise the limit.

Why should read_file() be limited to being able to read no more than 1GB of a file on a 64bit machine with 32GB of ram?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu