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


Groups > comp.arch.embedded > #28712

Re: Dynamic allocation and newlib-nano

From Paul Rubin <no.email@nospam.invalid>
Newsgroups comp.arch.embedded
Subject Re: Dynamic allocation and newlib-nano
Date 2019-06-27 14:23 -0700
Organization A noiseless patient Spider
Message-ID <87tvcad8o6.fsf@nightsong.com> (permalink)
References <qf2835$ds8$1@dont-email.me>

Show all headers | View raw


pozz <pozzugno@gmail.com> writes:
> However the dynamic allocation algorithm appears very strange to me. I
> expected that malloc() returns always the start of the heap if the
> heap is completely free.

I wouldn't necessarily expect that, but your best bet is to inspect the
malloc library source code if you want to know what it is doing.

For your purpose I wonder if you could use an arena-style allocator
instead of a lot of small mallocs and frees.  That means allocate a
single chunk of memory, then sequentially allocate from within the
chunk, then free the whole chunk.

It's great that you have TCP and TLS working in so little ram, but I
wonder if you could make your life easier by using a bigger MCU with
more memory, so you don't have to manage it quite so carefully.

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Dynamic allocation and newlib-nano pozz <pozzugno@gmail.com> - 2019-06-27 13:08 +0200
  Re: Dynamic allocation and newlib-nano upsidedown@downunder.com - 2019-06-27 14:42 +0300
    Re: Dynamic allocation and newlib-nano pozz <pozzugno@gmail.com> - 2019-06-27 15:59 +0200
      Re: Dynamic allocation and newlib-nano Niklas Holsti <niklas.holsti@tidorum.invalid> - 2019-06-27 17:47 +0300
        Re: Dynamic allocation and newlib-nano pozz <pozzugno@gmail.com> - 2019-06-27 18:37 +0200
          Re: Dynamic allocation and newlib-nano Niklas Holsti <niklas.holsti@tidorum.invalid> - 2019-06-27 21:23 +0300
            Re: Dynamic allocation and newlib-nano pozz <pozzugno@gmail.com> - 2019-06-28 11:38 +0200
        Re: Dynamic allocation and newlib-nano George Neuner <gneuner2@comcast.net> - 2019-06-27 17:02 -0400
  Re: Dynamic allocation and newlib-nano Joe Chisolm <jchisolm6@earthlink.net> - 2019-06-27 12:09 -0500
  Re: Dynamic allocation and newlib-nano Paul Rubin <no.email@nospam.invalid> - 2019-06-27 14:23 -0700
    Re: Dynamic allocation and newlib-nano pozz <pozzugno@gmail.com> - 2019-06-28 08:42 +0200

csiph-web