|
From: | Frédéric Bernon |
Subject: | [lwip-devel] [bug #21077] lwip_stats.mem.used is inaccurate, sometimes negative |
Date: | Sat, 15 Sep 2007 10:02:27 +0000 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6 |
Follow-up Comment #3, bug #21077 (project lwip): Simple code to show the problem (with the current CVS HEAD): void main() { void* pmem[4]={NULL}; lwip_init(); stats_display(); pmem[0]=mem_malloc(7); pmem[1]=mem_malloc(23); pmem[2]=mem_malloc(17); pmem[3]=mem_malloc(11); stats_display(); mem_free(pmem[1]); pmem[1]=mem_malloc(3); stats_display(); mem_free(pmem[2]); mem_free(pmem[3]); mem_free(pmem[0]); stats_display(); mem_free(pmem[1]); stats_display(); } With such values in lwipopts.h : #define MEM_ALIGNMENT 1 #define MEM_SIZE 10240 I got this output : MEM HEAP avail: 10240 used: 0 max: 0 err: 0 MEM HEAP avail: 10240 used: 84 max: 84 err: 0 MEM HEAP avail: 10240 used: 73 max: 84 err: 0 MEM HEAP avail: 10240 used: 17 max: 84 err: 0 MEM HEAP avail: 10240 used: 65525 max: 84 err: 0 _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?21077> _______________________________________________ Message posté via/par Savannah http://savannah.nongnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |