[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [microblaze-uclinux] malloc



I need to use the mkdosfs to format a fat partition.  But mkdosfs uses
malloc to allocate about 5M memory to hold the fat table.  I got the same
error if I just change it to a 5M static array.

Yuan

-----Original Message-----
From: owner-microblaze-uclinux@xxxxxxxxxxxxxx
[mailto:owner-microblaze-uclinux@xxxxxxxxxxxxxx] On Behalf Of John Williams
Sent: Thursday, July 17, 2008 6:36 PM
To: microblaze-uclinux@xxxxxxxxxxxxxx
Subject: Re: [microblaze-uclinux] malloc

Hi Yuan,

Yuan Song wrote:
> Does anybody know why I can not allocate more than 4M of data.  The malloc
> will return fail.

The noMMU malloc() implementation just calls straight through to 
kmalloc(), the kernel's allocator.  It, in turn, is limited in the size 
of blocks it can give out.

If you are doing malloc() calls with requests larger than a couple of 
mbyte, I'd be taking a closer look at your app and system design, see if 
there's not a cleaner way to go.  Provide some more details and we might 
have some recommendations.

If you want to do it the evil way, use the C_MAIN_MEMORY_SIZE override 
in the MSS file to limit the kernel's memory extent, and hardcode a 
pointer somewhere up to the top of memory for your app to use.  But, you 
didn't hear it from me!

Regards,

John
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive :
http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/



___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/