Message caching method, memory allocator and message forwarding system
By using the first memory slice to store unshaved target messages in the memory allocator, the problem of memory resource waste caused by no fields in the message sharing information data structure is solved, and the saving and utilization rate of memory resources are achieved.
Patent Information
- Application Number
- CN202180003831.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-18
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2041-01-18
AI Technical Summary
When a message is forwarded through the hardware, if it is not transmitted through the TCP/IP protocol stack, many fields in the message sharing information data structure are not needed, but memory still needs to be allocated, resulting in wasted memory resources.
Using a message caching method, by using a first memory slice to store unshattered target packets in the memory allocator, the first memory slice includes a data packet cache area, a first data structure and a second data structure. The first data structure includes a first field and a second field, the first field indicates that the target message is not fragmented, and the second field carries the second data structure. In the case where the target message is not sharded, the second field is used to carry the second data structure, and at least the first address of the data packet buffer area is indicated by the second data structure, without requiring a separate memory slice for the second data structure.
It effectively saves memory resources, improves the utilization rate of memory resources, and avoids allocating and occupying unnecessary memory when it is not needed.