Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #107237

Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit?

From Ian Collins <ian-news@hotmail.com>
Newsgroups comp.lang.c
Subject Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit?
Date 2017-03-28 13:37 +1300
Message-ID <ejtpj0Fr72rU2@mid.individual.net> (permalink)
References <b89ce929-f3e4-45f5-9043-fed71931846b@googlegroups.com> <RJ-dndndsuhp0ETFnZ2dnUU7-bnNnZ2d@posted.internetamerica> <ef4e74be-c8cf-49d7-8a2a-b0e04ee8a962@googlegroups.com> <478jdc1tpnr7us6p6mgq95pdkql3ada5pp@4ax.com>

Show all headers | View raw


On 03/28/17 01:04 PM, Robert Wessel wrote:
> On Mon, 27 Mar 2017 12:29:20 -0700 (PDT), supercat@casperkitty.com

>> If a program won't be able to do anything useful unless it can get all the
>> memory it needs, a guarantee that a memory allocation request will either
>> succeed or force some kind of program termination can often eliminate the
>> need to have a lot of error-checking scattered throughout a program.
>
>
> If that's what you want, it's easy enough to write a routine that's
> small wrapper around malloc that abort if there's no storage available
> (I think you could do the same thing with a mallopt).  And even touch
> all the storage so obtained if you want to make sure it's committed.
> Then do all of those allocations up front.

A cleaner solution is to have a selection of allocator libraries on had 
for different uses (debugging, threading to name a couple).

-- 
Ian

Back to comp.lang.c | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? acidlategamer@gmail.com - 2017-03-27 01:23 -0700
  Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? "James R. Kuyper" <jameskuyper@verizon.net> - 2017-03-27 11:06 -0400
    Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? Ken Brody <kenbrody@spamcop.net> - 2017-03-27 14:50 -0400
    Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-03-27 21:17 +0100
      Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? Robert Wessel <robertwessel2@yahoo.com> - 2017-03-27 19:08 -0500
  Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? scott@slp53.sl.home (Scott Lurndal) - 2017-03-27 15:23 +0000
    Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2017-03-27 09:57 -0700
      Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? BartC <bc@freeuk.com> - 2017-03-27 18:14 +0100
  Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? gordonb.l1p2g@burditt.org (Gordon Burditt) - 2017-03-27 12:37 -0500
    Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? "James R. Kuyper" <jameskuyper@verizon.net> - 2017-03-27 13:53 -0400
    Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? scott@slp53.sl.home (Scott Lurndal) - 2017-03-27 18:06 +0000
    Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? supercat@casperkitty.com - 2017-03-27 12:29 -0700
      Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? Robert Wessel <robertwessel2@yahoo.com> - 2017-03-27 19:04 -0500
        Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? supercat@casperkitty.com - 2017-03-27 17:31 -0700
          Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? Ian Collins <ian-news@hotmail.com> - 2017-03-28 13:35 +1300
        Re: Does heap segment of a C program increases in the amount of RAM or is it fixed to a limit? Ian Collins <ian-news@hotmail.com> - 2017-03-28 13:37 +1300

csiph-web