grep-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Grep-devel] proposed new function for dfa


From: Paul Eggert
Subject: Re: [Grep-devel] proposed new function for dfa
Date: Tue, 22 Nov 2016 14:46:21 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 11/22/2016 11:05 AM, Arnold Robbins wrote:
+/* Copy the syntax settings from one dfa instance to another.
+   Saves considerable computation time if compiling many regular expressions
+   based on the same setting.  */
+void dfacopysyntax (struct dfa *to, const struct dfa *from)
+{
+  if (to != NULL && from != NULL)

Why check whether TO and FROM are non-null?

+    {
+       memset (to, 0, offsetof (struct dfa, dfaexec));

This does more than copy syntax from FROM to TO. It also clears out the rest of TO. Is that the intent? If so, it sounds like the function's name should be changed.

How does the function help improve gawk's performance? I looked in savannah gawk master but didn't see this function, so I guess you're using it in some non-published work.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]