Re: Minor Comments on Gmake Internals
Jon Forrest <[email protected]> Sat, 18 Dec 2021 08:08:59 -0800
| Newsgroups | gmane.comp.gnu.make.devel |
|---|---|
| Message-ID | <[email protected]> |
On 12/18/21 6:15 AM, Paul Smith wrote: > > There's no way to avoid this other than adding a check for a length of > 0 to every caller of the function, which obviously we don't want to do. We're talking small potatoes here, but from the point of view of overhead, putting a check for a 0 length before each call would require fewer resources than making the function call and doing the call to memcpy with a length of 0. If you're talking style that's different. In looking at the code again, I see a bunch of calls where variable_buffer_output is called with a non-zero constant length. There might be other calls where the length can't be 0. So, the number of calls that would need to be checked first is less than the total number of calls. This is all idle discussion. I don't expect you to actually change anything. Thanks, Jon