tApparently SuSE 9.1's X distribution uses even bigger buffers than the standard ones. 64kB appears to be enough for a stack in that case, but let's just go nuts and make the stacks enormous, so that it takes a few more doublings of X's stack needs before we run into this problem again. - plan9port - [fork] Plan 9 from user space
HTML git clone git://src.adamsgaard.dk/plan9port
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit a0e8d02d093e01fdadf8a16bc86fe18b0c4e82c3
DIR parent 8327d419814d5ccfa9c005b371267d783f585177
HTML Author: rsc <devnull@localhost>
Date: Sun, 23 Jan 2005 16:02:04 +0000
Apparently SuSE 9.1's X distribution uses even bigger
buffers than the standard ones. 64kB appears to be enough
for a stack in that case, but let's just go nuts and make
tthe stacks enormous, so that it takes a few more doublings
of X's stack needs before we run into this problem again.
The VM system should take care of not actually using most
of the memory anyway.
Diffstat:
M src/libdraw/x11-itrans.c | 3 ++-
M src/libdraw/x11-keyboard.c | 2 +-
M src/libdraw/x11-mouse.c | 2 +-
M src/libthread/thread.c | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
---
DIR diff --git a/src/libdraw/x11-itrans.c b/src/libdraw/x11-itrans.c
t@@ -21,7 +21,8 @@ __xtoplan9kbd(XEvent *e)
if(e->xany.type != KeyPress)
return -1;
- needstack(20*1024); /* X has some *huge* buffers in openobject */
+ needstack(64*1024); /* X has some *huge* buffers in openobject */
+ /* and they're even bigger on SuSE */
XLookupString((XKeyEvent*)e,NULL,0,&k,NULL);
if(k == XK_Multi_key || k == NoSymbol)
return -1;
DIR diff --git a/src/libdraw/x11-keyboard.c b/src/libdraw/x11-keyboard.c
t@@ -72,7 +72,7 @@ initkeyboard(char *file)
return nil;
kc->c = chancreate(sizeof(Rune), 20);
chansetname(kc->c, "kbdc");
- proccreate(_ioproc, kc, 32768);
+ proccreate(_ioproc, kc, 256*1024);
return kc;
}
DIR diff --git a/src/libdraw/x11-mouse.c b/src/libdraw/x11-mouse.c
t@@ -141,7 +141,7 @@ initmouse(char *file, Image *i)
chansetname(mc->c, "mousec");
mc->resizec = chancreate(sizeof(int), 2);
chansetname(mc->resizec, "resizec");
- proccreate(_ioproc, mc, 32768);
+ proccreate(_ioproc, mc, 256*1024);
return mc;
}
DIR diff --git a/src/libthread/thread.c b/src/libthread/thread.c
t@@ -578,7 +578,7 @@ main(int argc, char **argv)
p = procalloc();
_threadsetproc(p);
if(mainstacksize == 0)
- mainstacksize = 65536;
+ mainstacksize = 256*1024;
_threadcreate(p, threadmainstart, nil, mainstacksize);
scheduler(p);
_threaddaemonize();