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:
OBattler
2020-05-02 02:09:10 +02:00
parent 3e248fe54a
commit 5b87c654e1
2 changed files with 1 additions and 6 deletions

View File

@@ -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;