Skip to content

Commit 2d26122

Browse files
committed
Merge branch 'master' of jsoftware.com:jsource
# Conflicts: # test/g520.ijs
2 parents cb73378 + fde381b commit 2d26122

File tree

9 files changed

+42
-38
lines changed

9 files changed

+42
-38
lines changed

jsrc/j.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,11 @@ struct jtimespec jmtclk(void); //monotonic clock. Intended rel->abs conversions
532532
// NEW WAY
533533
// The named-call stack is used only when there is a locative, EXCEPT that after a call to 18!:4 it is used until the function calling 18!:4 returns.
534534
// Since startup calls 18!:4 without a name, we have to allow for the possibility of deep recursion in the name stack. Normally only a little of the stack is used
535+
#if defined(_WIN32)
535536
#define CSTACKSIZE (SY_64?12009472:1015808) // size we allocate in the calling function, aligned to 16k system page size
537+
#else
538+
#define CSTACKSIZE (SY_64?7946240:1015808) // OS default stack size 8MB, aligned to 16k system page size
539+
#endif
536540
#define CSTACKRESERVE 100000 // amount we allow for slop before we sample the stackpointer, and after the last check
537541
#else
538542
// OBSOLETE OLD WAY (with USECSTACK off)
@@ -2153,7 +2157,7 @@ extern JS gjt; // global for JPF (procs without jt)
21532157
/* strchr fails for CE MIPS - neg chars - spellit fails in ws.c for f=.+. */
21542158
#define strchr(a,b) (C*)strchr((unsigned char*)(a), (unsigned char)(b))
21552159
#endif
2156-
#if (defined(__arm__)||defined(__aarch64__)||defined(_M_ARM64)) && !defined(__MACH__)
2160+
#if (defined(__arm__)||defined(__aarch64__)||defined(_M_ARM64)) && !defined(__APPLE__)
21572161
// option -fsigned-char in android and raspberry
21582162
#ifdef strchr
21592163
#undef strchr

jsrc/jconsole.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
#include <signal.h>
1818
#include <stdint.h>
1919
#include <locale.h>
20-
#ifdef __MACH__
20+
#ifdef __APPLE__
2121
#include <xlocale.h>
2222
#endif
2323

2424
#include "j.h"
2525
#include "jeload.h"
2626

27-
#define J_STACK 0x1000000uL // 16mb
27+
#define J_STACK 0xc00000uL // 12mb
2828

2929
static int forceprmpt=0; /* emit prompt even if isatty is false */
3030
static int breadline=0; /* 0: none 1: libedit 2: linenoise */
@@ -68,7 +68,7 @@ char histfile[512];
6868
static int readlineinit()
6969
{
7070
if(hreadline)return 0; // already run
71-
#ifndef __MACH__
71+
#ifndef __APPLE__
7272
if(!(hreadline=dlopen("libedit.so.3",RTLD_LAZY)))
7373
if(!(hreadline=dlopen("libedit.so.2",RTLD_LAZY)))
7474
if(!(hreadline=dlopen("libedit.so.1",RTLD_LAZY)))
@@ -243,7 +243,7 @@ int main(int argc, char* argv[])
243243
free(argvv);
244244
}
245245

246-
#if !defined(WIN32)
246+
#if 0
247247
// set stack size to get limit error instead of crash
248248
struct rlimit lim;
249249
if(!getrlimit(RLIMIT_STACK,&lim)){

make2/build_jconsole.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,17 @@ LDFLAGS=" -ldl $LDTHREAD $macmin "
177177
;;
178178
darwin_j64arm) # darwin arm
179179
CFLAGS="$common $macmin -march=armv8-a+crc "
180-
LDFLAGS=" -ldl $LDTHREAD $macmin "
180+
LDFLAGS=" -Wl,-stack_size,0xc00000 -ldl $LDTHREAD $macmin "
181181
;;
182182
windows_j32)
183183
TARGET=jconsole.exe
184184
CFLAGS="$common -m32 "
185-
LDFLAGS=" -m32 -Wl,--stack=0x1000000,--subsystem,console -static-libgcc $LDTHREAD"
185+
LDFLAGS=" -m32 -Wl,--stack=0xc00000,--subsystem,console -static-libgcc $LDTHREAD"
186186
;;
187187
windows_j6*)
188188
TARGET=jconsole.exe
189189
CFLAGS="$common"
190-
LDFLAGS=" -Wl,--stack=0x1000000,--subsystem,console -static-libgcc $LDTHREAD"
190+
LDFLAGS=" -Wl,--stack=0xc00000,--subsystem,console -static-libgcc $LDTHREAD"
191191
;;
192192
*)
193193
echo no case for those parameters

makemsvc/jconsole/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ endif
1010
ifeq (1,${x64})
1111
CF1= -maes -msse3 -fno-strict-aliasing -Wno-parentheses -Wno-unused-variable -Wno-pointer-sign -Wno-missing-braces -Wno-char-subscripts -Wno-unused-value -Wno-unused-function -Wno-empty-body -Wno-sometimes-uninitialized -Wno-string-plus-int -Wno-unknown-pragmas -Wno-delete-non-abstract-non-virtual-dtor
1212
CFLAGS= ${PTHREADINC} ${FDEBUG} /DEMU_AVX=1 /WX /W3 /O2 /GS /D_USING_V110_SDK71_ /D_CRT_SECURE_NO_WARNINGS /MT ${CF1}
13-
FLAGS= ${LDEBUG} /STACK:0x10000000 /MACHINE:X64 /SUBSYSTEM:CONSOLE,5.02
13+
FLAGS= ${LDEBUG} /STACK:0xc00000 /MACHINE:X64 /SUBSYSTEM:CONSOLE,5.02
1414
else
1515
CF1= -m32 -msse2 -fno-strict-aliasing -Wno-parentheses -Wno-unused-variable -Wno-pointer-sign -Wno-missing-braces -Wno-char-subscripts -Wno-unused-value -Wno-unused-function -Wno-empty-body -Wno-sometimes-uninitialized -Wno-string-plus-int -Wno-unknown-pragmas -Wno-delete-non-abstract-non-virtual-dtor
1616
CFLAGS= ${PTHREADINC} ${FDEBUG} /WX /W3 /O2 /GS /D_USING_V110_SDK71_ /D_CRT_SECURE_NO_WARNINGS /MT ${CF1}
17-
FLAGS= ${LDEBUG} /STACK:0x10000000 /MACHINE:X86 /SUBSYSTEM:CONSOLE,5.01
17+
FLAGS= ${LDEBUG} /STACK:0xc00000 /MACHINE:X86 /SUBSYSTEM:CONSOLE,5.01
1818
endif
1919

2020
.SUFFIXES: .o

makemsvc/jconsole/makefile.win

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ LDEBUG = /DEBUG
1010
!if "1"=="$(x64)"
1111
CF1= -maes -msse3 -fno-strict-aliasing -Wno-parentheses -Wno-unused-variable -Wno-pointer-sign -Wno-missing-braces -Wno-char-subscripts -Wno-unused-value -Wno-unused-function -Wno-empty-body -Wno-sometimes-uninitialized -Wno-string-plus-int -Wno-unknown-pragmas -Wno-delete-non-abstract-non-virtual-dtor
1212
CFLAGS= $(PTHREADINC) $(FDEBUG) /DEMU_AVX=1 /WX /W3 /O2 /GS /D_USING_V110_SDK71_ /D_CRT_SECURE_NO_WARNINGS /MT $(CF1)
13-
FLAGS= $(LDEBUG) /STACK:0x10000000 /MACHINE:X64 /SUBSYSTEM:CONSOLE,5.02
13+
FLAGS= $(LDEBUG) /STACK:0xc00000 /MACHINE:X64 /SUBSYSTEM:CONSOLE,5.02
1414
!else
1515
CF1= -m32 -msse2 -fno-strict-aliasing -Wno-parentheses -Wno-unused-variable -Wno-pointer-sign -Wno-missing-braces -Wno-char-subscripts -Wno-unused-value -Wno-unused-function -Wno-empty-body -Wno-sometimes-uninitialized -Wno-string-plus-int -Wno-unknown-pragmas -Wno-delete-non-abstract-non-virtual-dtor
1616
CFLAGS= $(PTHREADINC) $(FDEBUG) /WX /W3 /O2 /GS /D_USING_V110_SDK71_ /D_CRT_SECURE_NO_WARNINGS /MT $(CF1)
17-
FLAGS= $(LDEBUG) /STACK:0x10000000 /MACHINE:X86 /SUBSYSTEM:CONSOLE,5.01
17+
FLAGS= $(LDEBUG) /STACK:0xc00000 /MACHINE:X86 /SUBSYSTEM:CONSOLE,5.01
1818
!endif
1919

2020
.SUFFIXES: .o

test/g100i.ijs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ NB. +/ D ----------------------------------------------------------------
7676

7777
plus=: 4 : 'x+y'
7878

79-
(+/ -:!.1e_11 plus/ ) x=:0.01*_1e9+? 11$2e9 NB. comparison not close because of different orders of operations
80-
(+/ -:!.1e_11 plus/ ) x=:0.01*_1e9+?4 11$2e9
81-
(+/"1 -:!.1e_11 plus/"1) x
82-
(+/ -:!.1e_11 plus/ ) x=:0.01*_1e9+?7 5 11$2e9
83-
(+/"1 -:!.1e_11 plus/"1) x
84-
(+/"2 -:!.1e_11 plus/"2) x
85-
(+/ -:!.1e_11 plus/ )@> x=:(0.01*_1e9+2e9 ?@$~ ])&.> 4 ,&.>/ >: i. 100
86-
(+/ -:!.1e_11 plus/ )@> x=:(0.01*_1e9+2e9 ?@$~ ])&.> >: i. 100
79+
(+/ -:!.5e_11 plus/ ) x=:0.01*_1e9+? 11$2e9 NB. comparison not close because of different orders of operations
80+
(+/ -:!.5e_11 plus/ ) x=:0.01*_1e9+?4 11$2e9
81+
(+/"1 -:!.5e_11 plus/"1) x
82+
(+/ -:!.5e_11 plus/ ) x=:0.01*_1e9+?7 5 11$2e9
83+
(+/"1 -:!.5e_11 plus/"1) x
84+
(+/"2 -:!.5e_11 plus/"2) x
85+
(+/ -:!.5e_11 plus/ )@> x=:(0.01*_1e9+2e9 ?@$~ ])&.> 4 ,&.>/ >: i. 100
86+
(+/ -:!.5e_11 plus/ )@> x=:(0.01*_1e9+2e9 ?@$~ ])&.> >: i. 100
8787

8888
NB. +/!.0 D ----------------------------------------------------------------
8989

@@ -107,12 +107,12 @@ NB. +/ Z ----------------------------------------------------------------
107107

108108
plus=: 4 : 'x+y'
109109

110-
(+/ -:!.1e_11 plus/ ) x=:j./0.01*_1e9+?2 11$2e9
111-
(+/ -:!.1e_11 plus/ ) x=:j./0.01*_1e9+?2 4 11$2e9
112-
(+/"1 -:!.1e_11 plus/"1) x
113-
(+/ -:!.1e_11 plus/ ) x=:j./0.01*_1e9+?2 7 5 11$2e9
114-
(+/"1 -:!.1e_11 plus/"1) x
115-
(+/"2 -:!.1e_11 plus/"2) x
110+
(+/ -:!.5e_11 plus/ ) x=:j./0.01*_1e9+?2 11$2e9
111+
(+/ -:!.5e_11 plus/ ) x=:j./0.01*_1e9+?2 4 11$2e9
112+
(+/"1 -:!.5e_11 plus/"1) x
113+
(+/ -:!.5e_11 plus/ ) x=:j./0.01*_1e9+?2 7 5 11$2e9
114+
(+/"1 -:!.5e_11 plus/"1) x
115+
(+/"2 -:!.5e_11 plus/"2) x
116116

117117

118118
NB. +/ X ----------------------------------------------------------------

test/g520.ijs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ prtpms =. ([: 1: smoutput@[ smoutput@'' smoutput@])
138138
prtpms =. -:
139139
bk =. _2 1 3 1e_8
140140
M =. |: _4 ]\ 0. 1 3 0 0 0.5 3 0 1 0 0 0 0 1e_9 0 0 NB. input by columns
141-
cons=.1e_11 1e_6 0.0 0 1. 1.0 _1 NB. ColThr MinPivot #freepasses #improvements #amounttoimproveby prirow
141+
cons=. 1e_11 1e_6 0.0 0 1. 1.0 _1 NB. ColThr MinPivot #freepasses #improvements #amounttoimproveby prirow
142142
Frow=. _4 _3 _2 _1. 0.
143143
bkg=.i.#M
144144
NB. Test DIP mode - on identity cols
@@ -281,7 +281,7 @@ delth'' NB. make sure we start with an empty system
281281

282282
bk =. _2 1 3 1e_8
283283
M =. |: _4 ]\ 0. 1 2.9 0 0 0.5 3 0 1 0 0 0 0 1e_9 0 0 NB. input by columns
284-
cons=.1e_11 1e_6 0.0 0 1. 1.0 _1 NB. ColThr MinPivot #freepasses #improvements #amounttoimproveby nvirt
284+
cons=. 1e_11 1e_6 0.0 0 1. 1.0 _1 NB. ColThr MinPivot #freepasses #improvements #amounttoimproveby nvirt
285285
Frow=. _4 _3 _2 _1. 0.
286286
bkg=.i.#M
287287
NB. Test DIP mode - on identity cols

test/gpoly.ijs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ test =: 3 : 0
1313
d=: p. r
1414
assert. *./ 1e_6 > c (+/@:|@[ %~ |@]) c p. >{:r
1515
assert. *./ 1e_13 > c %&(+/@:|)~ -/c,:d
16-
assert. (c p. z) -:!.1e_12 r p. z
17-
assert. (c p. z) -:!.1e_11 d p. z
18-
assert. (c p. x) -:!.1e_12 r p. x
19-
assert. (c p. x) -:!.1e_11 d p. x
16+
assert. (c p. z) -:!.5e_11 r p. z
17+
assert. (c p. z) -:!.5e_11 d p. z
18+
assert. (c p. x) -:!.5e_11 r p. x
19+
assert. (c p. x) -:!.5e_11 d p. x
2020
assert. (p. c) -: p. c,0 0 0 0 0
2121
1
2222
)

test/gt.ijs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ p=: (8 %~ _10+?4$20)&p.
8989
q=: (8 %~ _10+?3$20)&p.
9090
sin =: 1&o.
9191
92-
(p@q =!.1e_11 p@q T. 20) x=: (2^ _8)*_200+?30$400
93-
(q@p =!.1e_11 q@p T. 20) x
92+
(p@q =!.5e_11 p@q T. 20) x=: (2^ _8)*_200+?30$400
93+
(q@p =!.5e_11 q@p T. 20) x
9494
95-
(p@sin =!.1e_11 p@sin T. 40) x=: (2^_10)*_600+?30$1200
96-
(q@sin =!.1e_11 q@sin T. 40) x
97-
(p@:^ =!.1e_11 p@:^ T. 40) x
98-
(q@:^ =!.1e_11 q@:^ T. 40) x
95+
(p@sin =!.5e_11 p@sin T. 40) x=: (2^_10)*_600+?30$1200
96+
(q@sin =!.5e_11 q@sin T. 40) x
97+
(p@:^ =!.5e_11 p@:^ T. 40) x
98+
(q@:^ =!.5e_11 q@:^ T. 40) x
9999
100100
101101
NB. %@f t. -------------------------------------------------------------

0 commit comments

Comments
 (0)