[En-Nut-Discussion] Floating Point Memory Usage

Bob Wirka bobwirka at yahoo.com
Wed Oct 9 16:27:42 CEST 2013


It's an AT91SAM7X512 with software floating point.

Right on the Ethernet website (which I should have read), regarding floating point, it states that 16K is allocated on the first call to _sbrk(). This is exactly what was happening; _dtoa_r() in putf() was calling _sbrk(), allocating the memory.

I've since written my own d2a() function that doesn't allocate memory. It **seems** to work.


Bob Wirka
Realtime Control Works

On Wednesday, October 9, 2013 4:44 AM, "bon at elektron.ikp.physik.tu-darmstadt.de" <bon at elektron.ikp.physik.tu-darmstadt.de> wrote:
>>>>> "Bob" == Bob Wirka <bobwirka at yahoo.com> writes:

    Bob> Hello, Realized today that floating point eats an automatic 16K of
    Bob> ram on the first call to _sbrk(). I should read the manuals...

    Bob> It looks like setting LIB_HEAPSIZE to 4K will work (at first,
    Bob> anyway), but am I setting myself up for other problems?

    Bob> Without the default 16K, is 'newlib' likely to misbehave somewhere
    Bob> else?

With what processor are you working? What kind of floating point support,
hardware or software? If hardware, what float support did you compile for?

Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt

--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

More information about the En-Nut-Discussion mailing list