bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] regex: Pass the system regex if its only problem is 32-bit r


From: Bruno Haible
Subject: Re: [PATCH] regex: Pass the system regex if its only problem is 32-bit regoff_t
Date: Thu, 9 Sep 2010 17:24:34 +0200
User-agent: KMail/1.9.9

Eric,

> But you are right that on x86_64 glibc, we have:
> (gdb) p sizeof(regoff_t)
> $1 = 4
> (gdb) p sizeof(off_t)
> $2 = 8
> (gdb) p sizeof(ssize_t)
> $3 = 8
> (gdb) p sizeof(ptrdiff_t)
> $4 = 8
> 
> Should we go back to the Austin Group to further relax the requirements 
> on regoff_t to only be at least as large as int, with EOVERFLOW errors 
> mandated as appropriate?

This would make no sense to me. On x86_64 systems, strings can be 5 GB or
10 GB large without problems. Emacs can open files of this size and load
their contents into memory. It makes no sense to limit the range of strings
on which regexec can meaningfully work to those of size smaller than 2 GB.

It would be better to push the glibc people so that they offer some
preprocessor macro that makes regoff_t 64-bit wide - like it was done for
off_t.

Would glibc need to export additional symbols for this? Yes.

Would a compiled glibc need to contain two copies of the regex code? No, the
32-bit version could be a thin wrapper around the 64-bit version.

Bruno



reply via email to

[Prev in Thread] Current Thread [Next in Thread]