ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/State.xs
(Generate patch)

Comparing Coro/Coro/State.xs (file contents):
Revision 1.66 by root, Mon Dec 12 19:43:41 2005 UTC vs.
Revision 1.67 by root, Mon Dec 12 20:07:44 2005 UTC

5#include "EXTERN.h" 5#include "EXTERN.h"
6#include "perl.h" 6#include "perl.h"
7#include "XSUB.h" 7#include "XSUB.h"
8 8
9#include "patchlevel.h" 9#include "patchlevel.h"
10
11// threaded perls might need much more, 65536 or more,
12// which is 0.5 to 1MB
13#define STACKSIZE 16384
10 14
11#if PERL_VERSION < 6 15#if PERL_VERSION < 6
12# ifndef PL_ppaddr 16# ifndef PL_ppaddr
13# define PL_ppaddr ppaddr 17# define PL_ppaddr ppaddr
14# endif 18# endif
589 stack->gencnt = ctx->gencnt = 0; 593 stack->gencnt = ctx->gencnt = 0;
590 594
591 if (alloc) 595 if (alloc)
592 { 596 {
593#if HAVE_MMAP 597#if HAVE_MMAP
594 stack->ssize = 16384 * sizeof (long); /* mmap should do allocate-on-write for us */ 598 stack->ssize = STACKSIZE * sizeof (long); /* mmap should do allocate-on-write for us */
595 stack->sptr = mmap (0, stack->ssize, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0); 599 stack->sptr = mmap (0, stack->ssize, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, 0, 0);
596 if (stack->sptr == (void *)-1) 600 if (stack->sptr == (void *)-1)
597#endif 601#endif
598 { 602 {
599 /*FIXME*//*D*//* reasonable stack size! */ 603 /*FIXME*//*D*//* reasonable stack size! */
600 stack->ssize = - (8192 * sizeof (long)); 604 stack->ssize = - (STACKSIZE * sizeof (long));
601 New (0, stack->sptr, 8192, long); 605 New (0, stack->sptr, STACKSIZE, long);
602 } 606 }
603 } 607 }
604 else 608 else
605 stack->sptr = 0; 609 stack->sptr = 0;
606 610

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines