|
From: | Letschi |
Subject: | [lwip-users] Still a Bug with memory wasting after PPP reconnect? |
Date: | Sat, 7 Mar 2009 18:56:12 +0100 |
Hello! I am using PPP over a serial interface to
communicate with a GSM-Modem. This works fine, but I have the following
problem: After closing the PPP connection and reestablishing the
connection, my application crashes because pbuf_alloc returns NULL. The number
of reconnects the application “survives” depends on the define
MEM_SIZE (size of reserved heap memory). My application only uses
one pbuf_malloc-call: Int SendUdpMsg (udp_pcb *pUdpConn, void
*pBuff, int nLength ) { struct pbuf*
packet; char
* data; packet=(struct
pbuf *)pbuf_alloc(PBUF_TRANSPORT, nLength, PBUF_RAM); Assert(
packet != NULL ); data=""> memcpy(data,
pBuff, nLength ); udp_send(pUdpConn,
packet); pbuf_free(
packet ); return
nLength; } As you can see I free the allocated memory directly
after sending, so I don’t really know who is wasting my mem? Anyone an
idea?` Best regards, Letschi |
[Prev in Thread] | Current Thread | [Next in Thread] |