run_nfer should reuse its temporary pools

Issue #37 resolved
Sean Kauffman repo owner created an issue

Right now, in the interpreted code, run_nfer inits/destroys multiple pools every time run_nfer is called. This results in a lot of malloc/free calls (and mem-clears (or sets? I don’t remember)) that would do not strictly need to be happen. In the compiled code-path, for example, the pools are global and so these calls are avoided. Now, the downside to making these pools static or global is that run_nfer becomes non-reentrant (well, technically it already isn’t because add_interval is not) but it makes it so that any move to multi-threading must have a lock on run_nfer or else set up a thread pool and then have a separate pool per thread. This is really not a big deal, since multithreading is not a priority right now.

Comments (1)

  1. Log in to comment