This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [uClinux-dev] brk(2) and stack pointer


Shaun Jackman wrote:
> >What's the reason for the check?
> For the typical case where the heap is growing up towards the stack,which 
> is growing down, I wanted to check that the requested heaphasn't collided 
> with the stack.

You could still check that the new block doesn't contain the stack pointer.

That catches the heap growing into the stack, but not the stack
growing into the heap.

-- Jamie


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]