|
Message-ID: <00c001cfb0f1$3c88a9f0$b599fdd0$@codeaurora.org> Date: Tue, 5 Aug 2014 14:07:16 -0700 From: "Weiming Zhao" <weimingz@...eaurora.org> To: <musl@...ts.openwall.com> Subject: RE: How to setup pre-allocated heap stack space? Yes, I will check the limit of the heap. Just want to check with you if the basic idea is correct. Thanks a lot! -----Original Message----- From: Rich Felker [mailto:dalias@...ifal.cx] On Behalf Of Rich Felker Sent: Tuesday, August 05, 2014 2:05 PM To: musl@...ts.openwall.com Subject: Re: [musl] How to setup pre-allocated heap stack space? On Tue, Aug 05, 2014 at 01:59:21PM -0700, Weiming Zhao wrote: > Hi Rich, > > I'm using it on a bare-metal setup. So the heap space some fixed address. > So I think I should modify __brk() like: > uintptr_t __brk(uintptr_t newbrk) { > return newbrk == 0 ? HEAP_BASE : newbrk ; // assume heap is large > enough } Is that correct? I don't need to worry about free(), right? Well I would at least make sure you don't overflow into other memory, by checking against an upper bound for the heap. But yes, something like the above looks right. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.