History log of /netbsd-src/usr.bin/make/buf.c (Results 1 – 25 of 58)
Revision Date Author Comments
# adc3ee3b 28-Apr-2024 rillig <rillig@NetBSD.org>

make: don't reallocate memory after evaluating an expression

When an expression is evaluated, the resulting text is short-lived in
almost all cases. In particular, the compaction neither affects th

make: don't reallocate memory after evaluating an expression

When an expression is evaluated, the resulting text is short-lived in
almost all cases. In particular, the compaction neither affects the
target names nor the global variable values, which are the prime
candidates for permanent memory usage.

show more ...


# d3b2cbfc 19-Dec-2023 rillig <rillig@NetBSD.org>

make: clean up comments

No binary change, except for line numbers in assertions.


# d45705ac 01-Jun-2023 rillig <rillig@NetBSD.org>

make: shorten function names, clean up comments

No functional change.


# 6da1a2e8 08-Jan-2022 rillig <rillig@NetBSD.org>

make: inline Buf_Clear

No functional change.


# d6e0031a 15-Dec-2021 rillig <rillig@NetBSD.org>

make: prevent memory leaks from buffers

The warning about unused function results would have prevented the
memory leak that was fixed in cond.c 1.303 from 2021-12-13.


# a3eb6a7f 28-Nov-2021 rillig <rillig@NetBSD.org>

make: move duplicate function Buf_AddFlag to buf.c

It is used only for debug output, therefore performance doesn't matter.

No functional change.


# 009c8d86 21-Jun-2021 rillig <rillig@NetBSD.org>

make: use simpler upper bound for length in Buf_AddInt

No functional change.


# 0d32771f 30-Jan-2021 rillig <rillig@NetBSD.org>

make(1): remove __predict_false

The effect (at least on x86_64) is so minimal that it is not worth
cluttering the code.


# 989db9a0 30-Jan-2021 rillig <rillig@NetBSD.org>

make(1): inline Buf_GetAll


# 03dcdab9 30-Jan-2021 rillig <rillig@NetBSD.org>

make(1): only clean up the Buffer data in CLEANUP mode

Cleaning up the members is only useful during debugging but not during
use in production.


# 39649bbc 30-Jan-2021 rillig <rillig@NetBSD.org>

make(1): split Buf_Destroy into Buf_Done and Buf_DoneData

In all cases except one, the boolean argument to Buf_Destroy was
constant. Removing that argument by splitting the function into two
separa

make(1): split Buf_Destroy into Buf_Done and Buf_DoneData

In all cases except one, the boolean argument to Buf_Destroy was
constant. Removing that argument by splitting the function into two
separate functions makes the intention clearer on the call site. It
also removes the possibility for using the return value of Buf_Done,
which would have made no sense.

The function Buf_Done now pairs with Buf_Init, just as in HashTable and
Lst.

Even though Buf_Done is essentially a no-op, it is kept as a function,
both for symmetry with Buf_Init and for clearing the Buffer members
after use (this will be done only in CLEANUP mode, in a follow-up
commit).

show more ...


# b754dcb0 30-Dec-2020 rillig <rillig@NetBSD.org>

make(1): format multi-line comments


# 76736a6e 28-Dec-2020 rillig <rillig@NetBSD.org>

make(1): rename Buf_Expand_1 to Buf_Expand


# b9e13463 23-Nov-2020 rillig <rillig@NetBSD.org>

make(1): indent buf.c with tabs instead of spaces


# 84d259f4 07-Nov-2020 rillig <rillig@NetBSD.org>

make(1): make API of Buf_Init simpler

In most cases, the caller doesn't want to specify the exact number of
preallocated bytes.


# a0c92525 07-Nov-2020 rillig <rillig@NetBSD.org>

make(1): clean up code stylistically

* Replace character literal 0 with '\0'.
* Replace pointer literal 0 with NULL.
* Remove redundant parentheses.
* Parentheses in multi-line conditions are not re

make(1): clean up code stylistically

* Replace character literal 0 with '\0'.
* Replace pointer literal 0 with NULL.
* Remove redundant parentheses.
* Parentheses in multi-line conditions are not redundant at the
beginning of a line.
* Replace a few !ptr with ptr == NULL.
* Replace a few ptr with ptr != NULL.
* Replace (expr & mask) == 0 with !(expr & mask).
* Remove redundant braces for blocks in cases where the generated code
stays the same. (Assertions further down in the code would get
different line numbers.)
* Rename parameters in CondParser_String to reflect the data flow.
* Replace #ifdef notdef with #if 0.

The generated code stays exactly the same, at least with GCC 5.5.0 on
NetBSD 8.0 amd64 using the default configuration.

show more ...


# 12d3b8fc 24-Oct-2020 rillig <rillig@NetBSD.org>

make(1): remove macros MIN and MAX

These macros typically evaluate one of their arguments twice. Until
2020-08-31, they had not parenthesized their arguments properly. They
are only used in a few

make(1): remove macros MIN and MAX

These macros typically evaluate one of their arguments twice. Until
2020-08-31, they had not parenthesized their arguments properly. They
are only used in a few places, therefore it doesn't hurt much to have
them expanded.

show more ...


# cfeefe9d 24-Oct-2020 rillig <rillig@NetBSD.org>

make(1): clean up comments in buf.c


# 304dea8c 27-Sep-2020 rillig <rillig@NetBSD.org>

make(1): in the Buffer functions, rename bp to buf

It's not necessary to emphasize on the pointerness of the variable since
that's obvious from the context.


# a5493079 27-Sep-2020 rillig <rillig@NetBSD.org>

make(1): rename Buffer fields

It was confusing to have a function Buf_Size that returns buf->count
even though there is also buf->size.


# 6de75a95 13-Sep-2020 rillig <rillig@NetBSD.org>

make(1): clean up RCSID blocks

These blocks mostly consisted of redundant structure, following the same
#ifndef pattern over and over, with only minimal variation.

It's easier to maintain if the co

make(1): clean up RCSID blocks

These blocks mostly consisted of redundant structure, following the same
#ifndef pattern over and over, with only minimal variation.

It's easier to maintain if the common structure is only written once and
encapsulated in a macro.

To avoid "defined but unused" warnings from GCC in the case where
MAKE_NATIVE is not defined, I had to add volatile. Adding
MAKE_ATTR_UNUSED alone would not preserve the rcsid variable in the
resulting binary.

show more ...


# e60129a6 23-Aug-2020 rillig <rillig@NetBSD.org>

make(1): clean up code in buf.c


# 450eb8e3 23-Aug-2020 rillig <rillig@NetBSD.org>

make(1): use common MAX macro instead of self-defined


# 5ad3310e 13-Aug-2020 rillig <rillig@NetBSD.org>

make(1): remove type alias Byte = char

This alias was only actually used in very few places, and changing it to
unsigned char or any other type would not be possible without generating
lots of compi

make(1): remove type alias Byte = char

This alias was only actually used in very few places, and changing it to
unsigned char or any other type would not be possible without generating
lots of compile-time errors. Therefore there was no abstraction, only
unnecessary complexity.

show more ...


# 173c9788 09-Aug-2020 rillig <rillig@NetBSD.org>

make(1): format the source code consistently, at least per file

Some files use 4 spaces per indentation level, others use 8. At least
for the few files from this commit, they use a consistent style

make(1): format the source code consistently, at least per file

Some files use 4 spaces per indentation level, others use 8. At least
for the few files from this commit, they use a consistent style
throughout each file now.

In Cond_Eval, the #define has changed into an enum since the identifiers
need not be visible to the C preprocessor.

show more ...


123