mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 20:48:21 +00:00
Pack some classes for better memory usages
- Analyzer: Reduce from 208 bytes to 192 bytes, remove one cache line - EventGroup: Reduce from 104 bytes to 96 bytes - Packet: Reduce from 200 bytes to 184 bytes, remove one cache line - threading::Value: Reduce from 48 bytes to 40 bytes - ConnTuple: push hole to the end of struct - TCP_Reassembler: Reduce from 240 bytes to 232 bytes
This commit is contained in:
parent
99023b14d5
commit
572adf3f23
6 changed files with 34 additions and 33 deletions
|
@ -160,16 +160,6 @@ public:
|
|||
*/
|
||||
uint32_t eth_type;
|
||||
|
||||
/**
|
||||
* Layer 2 source address.
|
||||
*/
|
||||
const u_char* l2_src = nullptr;
|
||||
|
||||
/**
|
||||
* Layer 2 destination address.
|
||||
*/
|
||||
const u_char* l2_dst = nullptr;
|
||||
|
||||
/**
|
||||
* (Outermost) VLAN tag if any, else 0.
|
||||
*/
|
||||
|
@ -208,6 +198,24 @@ public:
|
|||
*/
|
||||
bool l4_checksummed = false;
|
||||
|
||||
/**
|
||||
* Layer 2 source address.
|
||||
*/
|
||||
const u_char* l2_src = nullptr;
|
||||
|
||||
/**
|
||||
* Layer 2 destination address.
|
||||
*/
|
||||
const u_char* l2_dst = nullptr;
|
||||
|
||||
/**
|
||||
* This flag indicates whether a packet has been processed. This can
|
||||
* mean different things depending on the traffic, but generally it
|
||||
* means that a packet has been logged in some way. We default to
|
||||
* false, and this can be set to true for any number of reasons.
|
||||
*/
|
||||
bool processed = false;
|
||||
|
||||
/**
|
||||
* Indicates whether this packet should be recorded.
|
||||
*/
|
||||
|
@ -264,14 +272,6 @@ public:
|
|||
*/
|
||||
int gre_link_type = DLT_RAW;
|
||||
|
||||
/**
|
||||
* This flag indicates whether a packet has been processed. This can
|
||||
* mean different things depending on the traffic, but generally it
|
||||
* means that a packet has been logged in some way. We default to
|
||||
* false, and this can be set to true for any number of reasons.
|
||||
*/
|
||||
bool processed = false;
|
||||
|
||||
/**
|
||||
* The session related to this packet, if one exists.
|
||||
*/
|
||||
|
@ -283,7 +283,7 @@ private:
|
|||
|
||||
// True if we need to delete associated packet memory upon
|
||||
// destruction.
|
||||
bool copy;
|
||||
bool copy = false;
|
||||
};
|
||||
|
||||
} // namespace zeek
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue