mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
bifcl: Update codegen to use faster val_list and event queue API
This commit is contained in:
parent
a95808bc6b
commit
3b8932ff01
1 changed files with 6 additions and 8 deletions
|
@ -230,15 +230,15 @@ void print_event_c_body(FILE *fp)
|
||||||
fprintf(fp, "\t// allocation.\n");
|
fprintf(fp, "\t// allocation.\n");
|
||||||
fprintf(fp, "\n");
|
fprintf(fp, "\n");
|
||||||
|
|
||||||
fprintf(fp, "\tval_list* vl = new val_list;\n\n");
|
|
||||||
BuiltinFuncArg* connection_arg = 0;
|
BuiltinFuncArg* connection_arg = 0;
|
||||||
|
|
||||||
|
fprintf(fp, "\tmgr.QueueEventFast(%s, val_list{\n", decl.c_fullname.c_str());
|
||||||
|
|
||||||
for ( int i = 0; i < (int) args.size(); ++i )
|
for ( int i = 0; i < (int) args.size(); ++i )
|
||||||
{
|
{
|
||||||
fprintf(fp, "\t ");
|
fprintf(fp, "\t ");
|
||||||
fprintf(fp, "vl->append(");
|
|
||||||
args[i]->PrintBroValConstructor(fp);
|
args[i]->PrintBroValConstructor(fp);
|
||||||
fprintf(fp, ");\n");
|
fprintf(fp, ",\n");
|
||||||
|
|
||||||
if ( args[i]->Type() == TYPE_CONNECTION )
|
if ( args[i]->Type() == TYPE_CONNECTION )
|
||||||
{
|
{
|
||||||
|
@ -254,9 +254,7 @@ void print_event_c_body(FILE *fp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(fp, "\n");
|
fprintf(fp, "\t },\n\t SOURCE_LOCAL, analyzer->GetID(), timer_mgr");
|
||||||
fprintf(fp, "\tmgr.QueueEvent(%s, vl, SOURCE_LOCAL, analyzer->GetID(), timer_mgr",
|
|
||||||
decl.c_fullname.c_str());
|
|
||||||
|
|
||||||
if ( connection_arg )
|
if ( connection_arg )
|
||||||
// Pass the connection to the EventMgr as the "cookie"
|
// Pass the connection to the EventMgr as the "cookie"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue