History log of /netbsd-src/usr.bin/make/buf.h (Results 1 – 25 of 50)
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.


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

make: remove redundant comments for multiple-inclusion guards


# 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.


# 244fd9f4 03-Apr-2021 rillig <rillig@NetBSD.org>

make: use C99 bool type instead of defining its own

No functional change.


# 01fee323 30-Jan-2021 rillig <rillig@NetBSD.org>

make(1): inline Buf_Len


# 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


# 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 ...


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

make(1): rename Buf_Expand_1 to Buf_Expand


# d0ce6567 06-Dec-2020 rillig <rillig@NetBSD.org>

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


# a40fe9f7 10-Nov-2020 rillig <rillig@NetBSD.org>

make(1): use consistent definition for MAKE_INLINE


# 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.


# 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.


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

make(1): rename Buf_Size to Buf_Len

The new name better matches the field name Buffer.len as well as the
variables around the calls to this function.


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

make(1): prefer positive array index in Buf_AddByte

Ideally the condition for allocating more memory would have been
(old_len + 2 > bp->cap) since that's the actually intended wording. But
GCC 5 ne

make(1): prefer positive array index in Buf_AddByte

Ideally the condition for allocating more memory would have been
(old_len + 2 > bp->cap) since that's the actually intended wording. But
GCC 5 neglected to generate good code for that on x86_64, so be it.

show more ...


# 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.


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

make(1): replace direct access to Buffer fields with inline function

This way, renaming the fields of the buffer is restricted to only buf.h
and buf.c.


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

make(1): fix position of MAKE_ATTR_UNUSED in inline functions

The attribute needs to be before the return type, otherwise GCC 5
complains that Hash_GetValue is defined but not used, when compiling
w

make(1): fix position of MAKE_ATTR_UNUSED in inline functions

The attribute needs to be before the return type, otherwise GCC 5
complains that Hash_GetValue is defined but not used, when compiling
with USER_CPPFLAGS=-Dinline=. The other functions don't get any
warnings. It's probably because Hash_GetValue is the only inline
function that returns a pointer.

show more ...


# dc36bab2 01-Sep-2020 rillig <rillig@NetBSD.org>

make(1): clean up documentation in buf.h, and redundant include files


# 38e9e4c9 31-Aug-2020 rillig <rillig@NetBSD.org>

make(1): improve documentation for Buffer fields


# a3c983f2 25-Aug-2020 rillig <rillig@NetBSD.org>

make(1): allow make to be compiled in C90 mode

Since the inline functions are the only C99 feature used by now, setting
USER_CFLAGS='-std=c90 -ansi -Dinline=' is enough for compiling make with
a C90

make(1): allow make to be compiled in C90 mode

Since the inline functions are the only C99 feature used by now, setting
USER_CFLAGS='-std=c90 -ansi -Dinline=' is enough for compiling make with
a C90 compiler.

show more ...


12