[PATCH 3/3] regex: remove unnecessary dependency on localcharset.h

2012-12-30 Thread Paul Eggert
* lib/regex_internal.h [!_LIBC]: Don't include localcharset.h; hasn't been needed for years. * modules/regex (Depends-on): Remove localcharset. --- ChangeLog| 5 + lib/regex_internal.h | 3 --- modules/regex| 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH 2/3] regex: revert single-byte change

2012-12-30 Thread Paul Eggert
--- ChangeLog | 7 +++ lib/regexec.c | 6 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2363f6e..c1ef33d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2012-12-30 Paul Eggert + regex: revert single-byte change +

[PATCH 1/3] regex: simplify based on Gawk version

2012-12-30 Thread Paul Eggert
--- ChangeLog| 7 +++ lib/regex_internal.c | 6 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c3c7f1..2363f6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-12-30 Paul Eggert + + regex: simplify based on G

Re: [PATCH] Use malloca instead alloca

2012-12-30 Thread KOSAKI Motohiro
>> For platform specific way best solution is to read where bottom of stack is >> and allocate only when at least say 32768 bytes are left. >> > > And when knowing stack boundaries I could also recognize stack pointer > by single comparison. > > It needs to define _STACK_TOP,_STACK_CUP, _STACK_SIZE

Re: [PATCH] Use malloca instead alloca

2012-12-30 Thread KOSAKI Motohiro
> And on linux it will always succeed and be killed by oom later. I suspect you forgot /proc/sys/vm/overcommit_memory=2 (i.e. account always mode). Moreover, the default mode (/proc/sys/vm/overcommit_memory=1, ie account guess mode) also may return failure if you try obvious big size allocation.

Re: [PATCH] Use malloca instead alloca

2012-12-30 Thread Andreas Schwab
Ondřej Bílka writes: > static inline freea(void * __r) void Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."

Re: [PATCH] Use malloca instead alloca

2012-12-30 Thread Ondřej Bílka
On Sat, Dec 29, 2012 at 05:23:17PM +0100, Ondřej Bílka wrote: > On Sat, Dec 29, 2012 at 03:29:36PM +0100, Petr Baudis wrote: > > > > So it is still unsafe to call malloca() in a loop. This is also > > something that should be documented. Or can't we do better? I think even > > having an alternativ

Re: [PATCH] Use malloca instead alloca

2012-12-30 Thread Ondřej Bílka
On Sat, Dec 29, 2012 at 06:21:55PM -0800, Paul Eggert wrote: > On 12/29/2012 11:18 AM, Ondřej Bílka wrote: > > > alloca caused segfault on oom condition and null pointer > > access has equivalent behaviour. > > alloca doesn't always cause a SEGV on out of memory. > That's part of the problem that

[PATCH 6/6] regex: check that pattern char is single-byte

2012-12-30 Thread Paul Eggert
Reported by Aharon Robbins in . * lib/regexec.c (check_node_accept_bytes): Return 0 if the pattern string has a multibyte character here. --- ChangeLog | 6 ++ lib/regexec.c | 6 +- 2 files changed, 11 insertions(+), 1 deletion

[PATCH 5/6] regex: implement rational ranges

2012-12-30 Thread Paul Eggert
Reported by Aharon Robbins in . * lib/regcomp.c (build_range_exp) [!_LIBC]: * lib/regexec.c (check_node_accept_bytes) [!_LIBC]: Implement rational ranges. --- ChangeLog | 7 +++ lib/regcomp.c | 12 +++- lib/regexec.c | 12

[PATCH 4/6] regex: avoid redefining __wctype

2012-12-30 Thread Paul Eggert
Reported by Aharon Robbins in . * lib/regex_internal.h (__wctype, __iswctype) [!_LIBC]: #undef before defining. --- ChangeLog| 6 ++ lib/regex_internal.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/Ch

[PATCH 3/6] regex: port to hosts where malloc (0) == NULL

2012-12-30 Thread Paul Eggert
Reported by Aharon Robbins in . * lib/regex_internal.c (re_node_set_alloc): Don't assume that malloc (0) yields nonnull. * lib/regex_internal.h (MALLOC_0_IS_NONNULL): New macro. * m4/regex.m4 (gl_PREREQ_REGEX): Require gl_EEMALLOC. * module

[PATCH 2/6] regex: port to C89

2012-12-30 Thread Paul Eggert
--- ChangeLog | 5 + lib/regcomp.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5980ba1..b3e202a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2012-12-29 Paul Eggert + regex: port to C89 + Reported by Aharon R

FYI [PATCH 1/6] regex: merge glibc changes

2012-12-30 Thread Paul Eggert
--- ChangeLog| 8 lib/regcomp.c| 19 ++- lib/regex.c | 21 +++-- lib/regex.h | 19 ++- lib/regex_internal.c | 19 ++- lib/regex_internal.h | 21 +++-- lib/regexec.c