[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Use malloca instead alloca
From: |
KOSAKI Motohiro |
Subject: |
Re: [PATCH] Use malloca instead alloca |
Date: |
Sun, 30 Dec 2012 12:48:50 -0500 |
>> 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 macros for stack
> parameters.
> I can find them by pthread_attr_getstack but this call is slow.
I think this approach has two issues.
1) On LInux, RLIMIT_STACK doesn't affect to main thread. so there is
no reliable stack limit detection way. Think mmap vs stack expansion
race case for example.
2) setcontext/getcontext family provide to implement userland thread
(it is sometimes called fiber or green thread). so
pthread_attr_getstack is not suitable for getting generic stack
knowledge.
I suppose original hardcoded 4096 boundary is best.
Thank you.
- Re: [PATCH] Use malloca instead alloca, (continued)
- Message not available
- Re: [PATCH] Use malloca instead alloca, Ondřej Bílka, 2012/12/29
- Re: [PATCH] Use malloca instead alloca, Paul Eggert, 2012/12/29
- Re: [PATCH] Use malloca instead alloca, Ondřej Bílka, 2012/12/29
- Re: [PATCH] Use malloca instead alloca, Paul Eggert, 2012/12/29
- Re: [PATCH] Use malloca instead alloca, Ondřej Bílka, 2012/12/30
- Re: [PATCH] Use malloca instead alloca, KOSAKI Motohiro, 2012/12/30
- Re: [PATCH] Use malloca instead alloca, Petr Baudis, 2012/12/29
- Re: [PATCH] Use malloca instead alloca, Ondřej Bílka, 2012/12/29
- Re: [PATCH] Use malloca instead alloca, Ondřej Bílka, 2012/12/30
- Re: [PATCH] Use malloca instead alloca, Andreas Schwab, 2012/12/30
- Re: [PATCH] Use malloca instead alloca,
KOSAKI Motohiro <=
- Message not available
- Message not available
- Re: [PATCH] Use malloca instead alloca, Andreas Schwab, 2012/12/29