mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-27 02:26:55 +08:00
altcp: allocate altcp_pcbs from a pool, not from heap (new option MEMP_NUM_ALTCP_PCB defaults to MEMP_NUM_TCP_PCB)
This commit is contained in:
@@ -399,6 +399,16 @@
|
||||
#define MEMP_NUM_TCP_SEG 16
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MEMP_NUM_ALTCP_PCB: the number of simultaneously active altcp layer pcbs.
|
||||
* (requires the LWIP_ALTCP option)
|
||||
* Connections with multiple layers require more than one altcp_pcb (e.g. TLS
|
||||
* over TCP requires 2 altcp_pcbs, one for TLS and one for TCP).
|
||||
*/
|
||||
#if !defined MEMP_NUM_ALTCP_PCB || defined __DOXYGEN__
|
||||
#define MEMP_NUM_ALTCP_PCB MEMP_NUM_TCP_PCB
|
||||
#endif
|
||||
|
||||
/**
|
||||
* MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for
|
||||
* reassembly (whole packets, not fragments!)
|
||||
|
||||
@@ -52,6 +52,10 @@ LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_lis
|
||||
LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg), "TCP_SEG")
|
||||
#endif /* LWIP_TCP */
|
||||
|
||||
#if LWIP_ALTCP && LWIP_TCP
|
||||
LWIP_MEMPOOL(ALTCP_PCB, MEMP_NUM_ALTCP_PCB, sizeof(struct altcp_pcb), "ALTCP_PCB")
|
||||
#endif /* LWIP_ALTCP && LWIP_TCP */
|
||||
|
||||
#if LWIP_IPV4 && IP_REASSEMBLY
|
||||
LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA")
|
||||
#endif /* LWIP_IPV4 && IP_REASSEMBLY */
|
||||
|
||||
Reference in New Issue
Block a user