Changed the packet structure's data field to a 65536-byte array to need less malloc'ing and free'ing, significantly reducing heap fragmentation.
This commit is contained in:
@@ -71,7 +71,7 @@ typedef int (*NETSETLINKSTATE)(void *);
|
||||
|
||||
typedef struct netpkt {
|
||||
void *priv;
|
||||
uint8_t *data;
|
||||
uint8_t data[65536]; /* Maximum length + 1 to round up to the nearest power of 2. */
|
||||
int len;
|
||||
|
||||
struct netpkt *prev, *next;
|
||||
|
||||
Reference in New Issue
Block a user