make-alpha
[Top][All Lists]
Advanced

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

Re: Minor Comments on Gmake Internals


From: Jon Forrest
Subject: Re: Minor Comments on Gmake Internals
Date: Sat, 18 Dec 2021 08:08:59 -0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.0

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





reply via email to

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