History log of /lighttpd1.4/src/array.c (Results 1 – 25 of 82)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: lighttpd-1.4.69, lighttpd-1.4.68
# 5e14db43 10-Dec-2022 Glenn Strauss <[email protected]>

[multiple] employ ck_calloc, ck_malloc shared code

employ ck_calloc(), ck_malloc() shared code to slightly reduce code size
(centralize the ck_assert() to check that memory allocation succeeded)


# c412bb59 08-Dec-2022 Glenn Strauss <[email protected]>

[multiple] employ ck_realloc_u32() shared code

employ ck_realloc_u32() shared code to slightly reduce code size


Revision tags: lighttpd-1.4.67, lighttpd-1.4.66, lighttpd-1.4.65, lighttpd-1.4.64
# ae2fb974 06-Jan-2022 Stefan Bühler <[email protected]>

[array] use speaking names for array "fn" vtables for better debugging experience


Revision tags: lighttpd-1.4.63, lighttpd-1.4.62
# 57c0859f 10-Nov-2021 Glenn Strauss <[email protected]>

[core] uint_fast32_t tweaks

use uint_fast32_t in a few more places, where it yields better asm


Revision tags: lighttpd-1.4.61, lighttpd-1.4.60
# af3df29a 09-Jun-2021 Glenn Strauss <[email protected]>

[multiple] reduce redundant NULL buffer checks

This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot co

[multiple] reduce redundant NULL buffer checks

This commit is a large set of code changes and results in removal of
hundreds, perhaps thousands, of CPU instructions, a portion of which
are on hot code paths.

Most (buffer *) used by lighttpd are not NULL, especially since buffers
were inlined into numerous larger structs such as request_st and chunk.

In the small number of instances where that is not the case, a NULL
check is often performed earlier in a function where that buffer is
later used with a buffer_* func. In the handful of cases that remained,
a NULL check was added, e.g. with r->http_host and r->conf.server_tag.

- check for empty strings at config time and set value to NULL if blank
string will be ignored at runtime; at runtime, simple pointer check
for NULL can be used to check for a value that has been set and is not
blank ("")
- use buffer_is_blank() instead of buffer_string_is_empty(),
and use buffer_is_unset() instead of buffer_is_empty(),
where buffer is known not to be NULL so that NULL check can be skipped
- use buffer_clen() instead of buffer_string_length() when buffer is
known not to be NULL (to avoid NULL check at runtime)
- use buffer_truncate() instead of buffer_string_set_length() to
truncate string, and use buffer_extend() to extend

Examples where buffer known not to be NULL:
- cpv->v.b from config_plugin_values_init is not NULL if T_CONFIG_BOOL
(though we might set it to NULL if buffer_is_blank(cpv->v.b))
- address of buffer is arg (&foo)
(compiler optimizer detects this in most, but not all, cases)
- buffer is checked for NULL earlier in func
- buffer is accessed in same scope without a NULL check (e.g. b->ptr)

internal behavior change:
callers must not pass a NULL buffer to some funcs.
- buffer_init_buffer() requires non-null args
- buffer_copy_buffer() requires non-null args
- buffer_append_string_buffer() requires non-null args
- buffer_string_space() requires non-null arg

show more ...


# 41916b58 23-May-2021 Glenn Strauss <[email protected]>

[core] return entry from array_insert_data_at_pos

(for convenience and to save a couple asm instructions)


# cc8e7107 23-May-2021 Glenn Strauss <[email protected]>

[core] make insert_dup an optional array method

make insert_dup an optional array method in data_methods
(currently used only for merging strings of type data_string)


# 4f8f83ea 20-May-2021 Glenn Strauss <[email protected]>

[core] move data_{array,integer,string} to array.c

move native data_* types into array.c
(the types are already declared in array.h)

The array data structure remains extendable, as is done with dat

[core] move data_{array,integer,string} to array.c

move native data_* types into array.c
(the types are already declared in array.h)

The array data structure remains extendable, as is done with data_config
(configfile) and data_auth (mod_auth), though array data structure
primary uses are at startup (config time) and header parsing. The
insertion logic into sorted list can be expensive for large lists,
so header parsing might choose a different data structure in the future.

show more ...


# fbe55825 20-May-2021 Glenn Strauss <[email protected]>

[core] consolidate config printing code

funcs use only at startup and only for lighttpd -p


# 942c2f67 19-May-2021 Glenn Strauss <[email protected]>

[core] remove excess counts from print config

remove excess counts from print config
simplify double-quoted string printing


# 30edc55b 18-May-2021 Glenn Strauss <[email protected]>

[core] adjust some array code (better asm)

slightly reorganize some code for better asm


Revision tags: lighttpd-1.4.59
# 0045b9aa 26-Jan-2021 Glenn Strauss <[email protected]>

[core] const data_unset *array_get_element_klen()

return (const data_unset *) from array_get_element_klen();
use array_get_data_unset() for non-const (note: marked attribute cold)


Revision tags: lighttpd-1.4.58, lighttpd-1.4.57
# fefdf7f0 16-Dec-2020 Glenn Strauss <[email protected]>

[core] fix array_copy_array() sorted[]

fix array_copy_array() sorted[]
(current use appears to be only on value lists; not user-visible issue)

Some time back, sorted[] was a set of indexes into dat

[core] fix array_copy_array() sorted[]

fix array_copy_array() sorted[]
(current use appears to be only on value lists; not user-visible issue)

Some time back, sorted[] was a set of indexes into data[],
and therefore sorted[] could be copied when copying array.
Now that sorted[] is a list of pointers, the sorted[] list
must be rebuilt. If copied, it continued to point to
(data_unset *) from the original src array, not the dst array.

show more ...


Revision tags: lighttpd-1.4.56, lighttpd-1.4.56-rc7, lighttpd-1.4.56-rc6, lighttpd-1.4.56-rc5, lighttpd-1.4.56-rc4, lighttpd-1.4.56-rc3, lighttpd-1.4.56-rc2, lighttpd-1.4.56-rc1
# 2e0676fd 11-Sep-2020 Glenn Strauss <[email protected]>

[core] extend (data_string *) to store header id

(optional addition to (data_string *), used by http_header.[ch])

extend (data_string *) instead of creating another data_* TYPE_*
(new data type w

[core] extend (data_string *) to store header id

(optional addition to (data_string *), used by http_header.[ch])

extend (data_string *) instead of creating another data_* TYPE_*
(new data type would probably have (data_string *) as base class)
(might revisit choice in the future)

HTTP_HEADER_UNSPECIFIED has been removed. It was used in select
locations as an optimization to avoid looking up enum header_header_e
before checking the array, but the ordering in the array now relies
on having the id. Having the id allows for a quick check if a common
header is present or not in the htags bitmask, before checking the
array, and allows for integer comparison in the log(n) search of the
array, instead of strncasecmp().

With HTTP_HEADER_UNSPECIFIED removed, add optimization to set bit
in htags for HTTP_HEADER_OTHER when an "other" header is added,
but do not clear the bit, as there might be addtl "other" headers

show more ...


# 68ec5ad6 11-Sep-2020 Glenn Strauss <[email protected]>

[core] array.[ch] using uint32_t instead of size_t


# c58b95f2 10-Sep-2020 Glenn Strauss <[email protected]>

[core] light_isupper(), light_islower()

more efficient char checks
(replace one comparision and one branch with one subtraction)


# b600b75f 10-Aug-2020 Glenn Strauss <[email protected]>

[core] inline buffer_reset()

buffer_reset() is used on pre-allocated buffers, so remove NULL check


# e1bb5793 10-Aug-2020 Glenn Strauss <[email protected]>

[core] disperse settings.h to appropriate headers


# 28f1867c 08-Jul-2020 Glenn Strauss <[email protected]>

quiet clang analyzer scan-build warnings

(expansion of buffer_string_lenth() inline function and CONST_BUF_LEN()
macro, which always check for NULL, appears to cause the analyzer to
believe that a

quiet clang analyzer scan-build warnings

(expansion of buffer_string_lenth() inline function and CONST_BUF_LEN()
macro, which always check for NULL, appears to cause the analyzer to
believe that a pointer might be NULL in cases where it otherwise can
not be NULL)

x-ref:
http://clang-analyzer.llvm.org/faq.html

show more ...


# c752d469 22-Feb-2020 Glenn Strauss <[email protected]>

[multiple] correct misspellings in comments

x-ref:
"Script for fixing spelling errors with codespell"
https://redmine.lighttpd.net/boards/3/topics/8947


Revision tags: lighttpd-1.4.55
# f24e6d69 28-Nov-2019 Glenn Strauss <[email protected]>

[multiple] plugin_stats array

use global rather than passing around (server *) just for that

li_itostrn() and li_utostrn() return string length
(rather than requiring subsequent strlen() to find le

[multiple] plugin_stats array

use global rather than passing around (server *) just for that

li_itostrn() and li_utostrn() return string length
(rather than requiring subsequent strlen() to find length)

show more ...


# 010c2894 25-Nov-2019 Glenn Strauss <[email protected]>

[multiple] prefer (connection *) to (srv *)

convert all log_error_write() to log_error() and pass (log_error_st *)

use con->errh in preference to srv->errh (even though currently same)

avoid passi

[multiple] prefer (connection *) to (srv *)

convert all log_error_write() to log_error() and pass (log_error_st *)

use con->errh in preference to srv->errh (even though currently same)

avoid passing (server *) when previously used only for logging (errh)

show more ...


# 24680a91 22-Nov-2019 Glenn Strauss <[email protected]>

[core] array_init() arg for initial size


# e3dc34d1 16-Oct-2019 Glenn Strauss <[email protected]>

[core] array a->sorted[] as ptrs rather than pos

While slightly more memory use in 64-bit (though same memory use as
prior versions of lighttpd), avoids bouncing through second array
when searching

[core] array a->sorted[] as ptrs rather than pos

While slightly more memory use in 64-bit (though same memory use as
prior versions of lighttpd), avoids bouncing through second array
when searching in sorted list. Most use of arrays in lighttpd is to
build a list once, and elements are not removed from the list.

show more ...


# a762402d 14-Oct-2019 Glenn Strauss <[email protected]>

[core] keep a->data[] sorted (REVERT)

This reverts commit 2260a8062ee599ecf28d9b52b981603fd2084aff.

original ordering of array elements is significant
e.g. in lighttpd.conf lists where first match

[core] keep a->data[] sorted (REVERT)

This reverts commit 2260a8062ee599ecf28d9b52b981603fd2084aff.

original ordering of array elements is significant
e.g. in lighttpd.conf lists where first match to request is applied

show more ...


1234