chipKIT® Development Platform

Inspired by Arduino™

malloc > 2048 bytes

Created Thu, 23 Feb 2012 16:11:14 +0000 by Mark597


Mark597

Thu, 23 Feb 2012 16:11:14 +0000

I have an UNO32 and have adjusted the heap size from the default 2K to 8K. I used the method KiethV posted and it worked. I can allocate 2048 bytes of memory and use it without issue. If I try to allocate more than this in one block it is successful but data stored to the chunck of memory is not completely intact.

I can allocate 2048 bytes and my program works. If I allocate 2049 bytes it does not.

Does anyone know why?


davervw

Sat, 25 Feb 2012 21:26:43 +0000

The answer is at [url]http://www.chipkit.org/forum/viewtopic.php?f=19&t=655&p=4142&hilit=CHANGE_HEAP_SIZE#p4142[/url]


Mark597

Sun, 26 Feb 2012 17:53:20 +0000

Thanks, for the reply "davervw". I did see that post.

It was my mistake. The problem was not to do with malloc or adjusting the heap size as I thought when I posted this originally.

The Ethernet library is limited to the size of size_t data type for a number of bytes sent at once.

client.write( buffer, size_t size);

I'm going to see if I can increase this when I get time.