/[lwip]/lwip/src/core/mem.c
ViewVC logotype

Diff of /lwip/src/core/mem.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by jani, Fri Feb 21 16:43:46 2003 UTC revision 1.10 by likewise, Mon Mar 24 10:29:03 2003 UTC
# Line 149  mem_free(void *rmem) Line 149  mem_free(void *rmem)
149        
150        
151    if((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) {    if((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) {
152      DEBUGF(MEM_DEBUG, ("mem_free: illegal memory\n"));      DEBUGF(MEM_DEBUG | 3, ("mem_free: illegal memory\n"));
153  #ifdef MEM_STATS  #ifdef MEM_STATS
154      ++lwip_stats.mem.err;      ++lwip_stats.mem.err;
155  #endif /* MEM_STATS */  #endif /* MEM_STATS */
# Line 199  mem_realloc(void *rmem, mem_size_t newsi Line 199  mem_realloc(void *rmem, mem_size_t newsi
199           (u8_t *)rmem < (u8_t *)ram_end);           (u8_t *)rmem < (u8_t *)ram_end);
200        
201    if((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) {    if((u8_t *)rmem < (u8_t *)ram || (u8_t *)rmem >= (u8_t *)ram_end) {
202      DEBUGF(MEM_DEBUG, ("mem_realloc: illegal memory\n"));      DEBUGF(MEM_DEBUG | 3, ("mem_realloc: illegal memory\n"));
203      return rmem;      return rmem;
204    }    }
205    mem = (struct mem *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);    mem = (struct mem *)((u8_t *)rmem - SIZEOF_STRUCT_MEM);
# Line 291  mem_malloc(mem_size_t size) Line 291  mem_malloc(mem_size_t size)
291        return (u8_t *)mem + SIZEOF_STRUCT_MEM;        return (u8_t *)mem + SIZEOF_STRUCT_MEM;
292      }          }    
293    }    }
294    DEBUGF(MEM_DEBUG, ("mem_malloc: could not allocate %d bytes\n", (int)size));    DEBUGF(MEM_DEBUG | 2, ("mem_malloc: could not allocate %d bytes\n", (int)size));
295  #ifdef MEM_STATS  #ifdef MEM_STATS
296    ++lwip_stats.mem.err;    ++lwip_stats.mem.err;
297  #endif /* MEM_STATS */    #endif /* MEM_STATS */  

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26