You need to tell the linker for that, the default is only a reasonable size for normal usage.Yoda wrote:what if application allocates too much memory on stack for local variables?
managing stack
Re: managing stack
Re: managing stack
I mean automation of this task from the point of view of OS design. I see one approach, but it doesn't look very elegant. This is to allocate stack by task with increments of 4096 bytes (one page) and "probing" new memory points to force page faults and stack allocation by OS until it reaches needed value. I don't like this. Also it requires special support from compiler/linker. I wonder if there is a nice and accurate method that allows to allocate task stack automatically by OS?
Re: managing stack
I would rather switch to 64-bit and have huge grap between heap and stack. (In fact I'm branching out a 64-bit kernel for the very same reason, the 32-bit address space are too crowed to separate things nicely...)
Re: managing stack
Individual stacks of each thread could still collide, if you have enough threads.bluemoon wrote:I would rather switch to 64-bit and have huge grap between heap and stack. (In fact I'm branching out a 64-bit kernel for the very same reason, the 32-bit address space are too crowed to separate things nicely...)