bifcl: Update codegen to use faster val_list and event queue API

This commit is contained in:
Jon Siwek 2019-04-11 19:31:37 -07:00 committed by Tim Wojtulewicz
parent a95808bc6b
commit 3b8932ff01

View file

@ -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"