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.11 by root, Tue Feb 8 23:11:35 2011 UTC vs.
Revision 1.12 by root, Mon Apr 1 03:10:26 2019 UTC

31 31
32#include "config.h" 32#include "config.h"
33 33
34#include <cstring> 34#include <cstring>
35#include <cstdlib> 35#include <cstdlib>
36#include <stdexcept>
36 37
37#include "slog.h" 38#include "slog.h"
38#include "device.h" 39#include "device.h"
39 40
40static void *pkt_cachep[PKTCACHESIZE]; 41static void *pkt_cachep[PKTCACHESIZE];
53 if (pkt_cachen) 54 if (pkt_cachen)
54 return pkt_cachep[--pkt_cachen]; 55 return pkt_cachep[--pkt_cachen];
55 else 56 else
56 { 57 {
57 void *p = malloc (sizeof (data_packet)); 58 void *p = malloc (sizeof (data_packet));
59
60 if (!p)
61 throw (std::bad_alloc ());
62
58 memset (p, 0, sizeof (data_packet)); 63 memset (p, 0, sizeof (data_packet));
59 return p; 64 return p;
60 } 65 }
61} 66}
62 67

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines