ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/device.C
(Generate patch)

Comparing gvpe/src/device.C (file contents):
Revision 1.10 by pcg, Thu Aug 7 17:54:26 2008 UTC vs.
Revision 1.11 by root, Tue Feb 8 23:11:35 2011 UTC

38#include "device.h" 38#include "device.h"
39 39
40static void *pkt_cachep[PKTCACHESIZE]; 40static void *pkt_cachep[PKTCACHESIZE];
41static int pkt_cachen = 0; 41static int pkt_cachen = 0;
42 42
43void *
43void *net_packet::operator new(size_t s) 44net_packet::operator new(size_t s)
44{ 45{
45 if (s > sizeof (data_packet)) 46 if (s > sizeof (data_packet))
46 { 47 {
47 slog (L_ERR, _("FATAL: allocation for network packet larger than max supported packet size (%d > %d)."), 48 slog (L_ERR, _("FATAL: allocation for network packet larger than max supported packet size (%d > %d)."),
48 s, sizeof (data_packet)); 49 s, sizeof (data_packet));
57 memset (p, 0, sizeof (data_packet)); 58 memset (p, 0, sizeof (data_packet));
58 return p; 59 return p;
59 } 60 }
60} 61}
61 62
63void
62void net_packet::operator delete(void *p) 64net_packet::operator delete(void *p)
63{ 65{
64 if (p) 66 if (p)
65 { 67 {
66 if (pkt_cachen < PKTCACHESIZE) 68 if (pkt_cachen < PKTCACHESIZE)
67 { 69 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines