lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] mem_malloc()


From: Christiaan Simons
Subject: Re: [lwip-users] mem_malloc()
Date: Wed, 08 Dec 2004 10:31:54 +0100

On Mon, 2004-12-06 at 12:40, Aidan Hammel wrote:


> malloc seems quite happy to allocate more memory than is available,
> leading to crashes.

Do you check the return value of malloc()?
If its NULL you're out of memory. Some compilers
have a setting for the memory heap used by malloc.
Check if this heap is large enough for your application.

If you are sure malloc is broken,
please report this to the ones
that wrote your c library...

>  I'm guessing I need to use mem_alloc (in mem.c).

When your malloc is really broken,
you could consider using lwip private allocators.

Then you must increase the lwipopts.h MEM_SIZE.
 
> Can anybody see what I'm doing wrong? Is mem_malloc the right function
> or does it do something completely different?

mem_malloc() should work just fine.
if it fails you could try to debug it
using the LWIP_ASSERT() macro's.

Bye,
Christiaan Simons


The information contained in this communication is confidential and is intended 
solely for the use of the individual or entity to whom it is addressed. Axon 
Digital Design Group is neither liable for the proper nor for the complete 
transmission of the information contained in this communication nor for any 
delay in its receipt. Axon Digital Design Group does not guarantee that the 
integrity of this communication has been maintained nor that the communication 
is free of viruses, interceptions or interference. If you are not the intended 
recipient of this communication, you are hereby notified that reading, 
disseminating, distributing or copying this message is strictly prohibited. In 
that case please return the communication to the sender and delete and destroy 
all copies. In carrying out its engagements, Axon Digital Design Group applies 
general terms and conditions, which contain a clause that limits its liability. 
A copy of these terms and conditions is available on request free of charge.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]