Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: tlug: gcc question
- To: tlug@example.com
- Subject: Re: tlug: gcc question
- From: Fredric Fredricson <fredric.fredriksson@example.com>
- Date: Thu, 20 Jan 2000 03:26:04 +0100
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
- Organization: MYDATA automation AB
- References: <Pine.LNX.4.10.10001121547550.26141-100000@example.com> <387DB3D3.15948545@example.com> <14461.53588.914038.845367@example.com> <387DDEE5.91F624DE@example.com> <14466.46047.822694.666971@example.com> <3883BD82.C28E3890@example.com> <14467.63547.386201.289028@example.com>
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
"Stephen J. Turnbull" wrote: > > Fredric> Malloc use sbrk(2) (or brk(2)) to ask the kernel for more > Fredric> memory when it needs it (there are btw probably also > Fredric> other ways than sbrk(2) to do this). > > The man page doesn't say so, but there may be a POSIX way to get > memory (brk and sbrk are not POSIX). There is mmap(2) (POSIX). I was told by somebody that I consider very good on Linux kernel code that modern malloc implementation probably use mmap(2) and leaves unaccessible pages to fence in some areas, for example the internal data structures. The only part that bugs me is that I can not see that it would be possible to used both sbrk(2) and mmap(2) in the same program. Maybe malloc does not use mmap(2) or maybe mmap(2) can be used in a "safe" way together with sbrk(2). > > Fredric> Consider the following c program: > > It works for me too, although I don't know how offhand to determine > whether malloc is requesting integral multiples of the pagesize from > sbrk. > > However, I do not get all the way to the end of the segment; in my > case, the stdout buffer doesn't get flushed before the SEGV occurs. > What version of glibc do you have? (Mine is glibc 2.1.2, Debian > package revision 10.) Well, you caught me with my pants down here ;-). I cheated and copied the first part from stdout redirected to a file and the last was part copy-paste from output to an xterm. My glibc is by the way also 2.1.2. /Fredric -------------------------------------------------------------------- Next Nomikai Meeting: February 18 (Fri) 19:00 Tengu TokyoEkiMae Next Technical Meeting: March 11 (Sat) 13:00 Temple University Japan * Topic: TBD -------------------------------------------------------------------- more info: http://www.tlug.gr.jp Sponsor: Global Online Japan
- References:
- Re: tlug: gcc question
- From: "Scott M. Stone" <sstone@example.com>
- Re: tlug: gcc question
- From: Fredric Fredricson <Fredric.Fredriksson@example.com>
- Re: tlug: gcc question
- From: "Stephen J. Turnbull" <turnbull@example.com>
- Re: tlug: gcc question
- From: Fredric Fredricson <Fredric.Fredriksson@example.com>
- Re: tlug: gcc question
- From: "Stephen J. Turnbull" <turnbull@example.com>
- Re: tlug: gcc question
- From: Fredric Fredricson <fredric.fredriksson@example.com>
- Re: tlug: gcc question
- From: "Stephen J. Turnbull" <turnbull@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: tlug: automated login & startx, etc
- Next by Date: Re: tlug: automated login & startx, etc
- Prev by thread: Re: tlug: gcc question
- Next by thread: Re: tlug: gcc question
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links