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:
Max Kellermann 2020-02-02 16:29:27 +01:00
parent 0db61f3094
commit 6a815b4b06
38 changed files with 348 additions and 211 deletions

View file

@ -2,8 +2,8 @@
#pragma once
#include "BroList.h"
#include "analyzer/Analyzer.h"
#include "Val.h"
class EventMgr;
@ -77,16 +77,7 @@ public:
// existence check.
void QueueEvent(const EventHandlerPtr &h, val_list vl,
SourceID src = SOURCE_LOCAL, analyzer::ID aid = 0,
TimerMgr* mgr = 0, BroObj* obj = 0)
{
if ( h )
QueueEvent(new Event(h, std::move(vl), src, aid, mgr, obj));
else
{
for ( const auto& v : vl )
Unref(v);
}
}
TimerMgr* mgr = 0, BroObj* obj = 0);
// Same as QueueEvent, except taking the event's argument list via a
// pointer instead of by value. This function takes ownership of the
@ -100,12 +91,7 @@ public:
delete vl;
}
void Dispatch(Event* event, bool no_remote = false)
{
current_src = event->Source();
event->Dispatch(no_remote);
Unref(event);
}
void Dispatch(Event* event, bool no_remote = false);
void Drain();
bool IsDraining() const { return draining; }