mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
UID, ..: un-inline methods to reduce header dependencies
Only 1% build time speedup, but still, it declutters the headers a bit. Before this patch: 2565.17user 141.83system 2:25.46elapsed 1860%CPU (0avgtext+0avgdata 1489076maxresident)k 72576inputs+9130920outputs (1667major+49400430minor)pagefaults 0swaps After this patch: 2537.19user 142.94system 2:26.90elapsed 1824%CPU (0avgtext+0avgdata 1434268maxresident)k 16240inputs+8887152outputs (1931major+48728888minor)pagefaults 0swaps
This commit is contained in:
parent
0db61f3094
commit
6a815b4b06
38 changed files with 348 additions and 211 deletions
27
src/IPAddr.h
27
src/IPAddr.h
|
@ -2,8 +2,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "BroString.h"
|
||||
#include "Hash.h"
|
||||
#include "threading/SerialTypes.h"
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
@ -13,6 +11,8 @@
|
|||
|
||||
using std::string;
|
||||
struct ConnID;
|
||||
class BroString;
|
||||
class HashKey;
|
||||
namespace analyzer { class ExpectedConn; }
|
||||
|
||||
typedef in_addr in4_addr;
|
||||
|
@ -112,10 +112,7 @@ public:
|
|||
* @param s String containing an IP address as either a dotted IPv4
|
||||
* address or a hex IPv6 address.
|
||||
*/
|
||||
explicit IPAddr(const BroString& s)
|
||||
{
|
||||
Init(s.CheckString());
|
||||
}
|
||||
explicit IPAddr(const BroString& s);
|
||||
|
||||
/**
|
||||
* Constructs an address instance from a raw byte representation.
|
||||
|
@ -254,10 +251,7 @@ public:
|
|||
* Returns a key that can be used to lookup the IP Address in a hash
|
||||
* table. Passes ownership to caller.
|
||||
*/
|
||||
HashKey* GetHashKey() const
|
||||
{
|
||||
return new HashKey((void*)in6.s6_addr, sizeof(in6.s6_addr));
|
||||
}
|
||||
HashKey* GetHashKey() const;
|
||||
|
||||
/**
|
||||
* Masks out lower bits of the address.
|
||||
|
@ -639,18 +633,7 @@ public:
|
|||
* Returns a key that can be used to lookup the IP Prefix in a hash
|
||||
* table. Passes ownership to caller.
|
||||
*/
|
||||
HashKey* GetHashKey() const
|
||||
{
|
||||
struct {
|
||||
in6_addr ip;
|
||||
uint32_t len;
|
||||
} key;
|
||||
|
||||
key.ip = prefix.in6;
|
||||
key.len = Length();
|
||||
|
||||
return new HashKey(&key, sizeof(key));
|
||||
}
|
||||
HashKey* GetHashKey() const;
|
||||
|
||||
/** Converts the prefix into the type used internally by the
|
||||
* inter-thread communication.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue