<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lighttpd.git/src/array.c, branch master</title>
<subtitle>lighttpd</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/atom/src/array.c?h=master</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/atom/src/array.c?h=master'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/'/>
<updated>2024-02-09T08:53:28Z</updated>
<entry>
<title>[core] array require nonnull for insert,replace</title>
<updated>2024-02-09T08:53:28Z</updated>
<author>
<name>Glenn Strauss</name>
<email>gstrauss@gluelogic.com</email>
</author>
<published>2024-02-05T06:02:40Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/commit/?id=32f971a661144c1d61c4cf64480340e7acbcf72c'/>
<id>urn:sha1:32f971a661144c1d61c4cf64480340e7acbcf72c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[multiple] employ ck_calloc, ck_malloc shared code</title>
<updated>2022-12-10T20:15:33Z</updated>
<author>
<name>Glenn Strauss</name>
<email>gstrauss@gluelogic.com</email>
</author>
<published>2022-12-10T20:15:33Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/commit/?id=5e14db43b7212b52f1cfcd2b0fce41df7fc419eb'/>
<id>urn:sha1:5e14db43b7212b52f1cfcd2b0fce41df7fc419eb</id>
<content type='text'>
employ ck_calloc(), ck_malloc() shared code to slightly reduce code size
(centralize the ck_assert() to check that memory allocation succeeded)
</content>
</entry>
<entry>
<title>[multiple] employ ck_realloc_u32() shared code</title>
<updated>2022-12-10T16:58:14Z</updated>
<author>
<name>Glenn Strauss</name>
<email>gstrauss@gluelogic.com</email>
</author>
<published>2022-12-08T05:26:46Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/commit/?id=c412bb59ce1488347a9f4d6d55e42de3f8567956'/>
<id>urn:sha1:c412bb59ce1488347a9f4d6d55e42de3f8567956</id>
<content type='text'>
employ ck_realloc_u32() shared code to slightly reduce code size
</content>
</entry>
<entry>
<title>[array] use speaking names for array "fn" vtables for better debugging experience</title>
<updated>2022-01-06T15:24:35Z</updated>
<author>
<name>Stefan Bühler</name>
<email>source@stbuehler.de</email>
</author>
<published>2022-01-06T15:23:10Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/commit/?id=ae2fb9749498e3490d50d2fdd056fa06700529fb'/>
<id>urn:sha1:ae2fb9749498e3490d50d2fdd056fa06700529fb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[core] uint_fast32_t tweaks</title>
<updated>2021-11-12T22:56:38Z</updated>
<author>
<name>Glenn Strauss</name>
<email>gstrauss@gluelogic.com</email>
</author>
<published>2021-11-10T16:27:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/commit/?id=57c0859fd7d7340f63164665816089c95689139d'/>
<id>urn:sha1:57c0859fd7d7340f63164665816089c95689139d</id>
<content type='text'>
use uint_fast32_t in a few more places, where it yields better asm
</content>
</entry>
<entry>
<title>[multiple] reduce redundant NULL buffer checks</title>
<updated>2021-08-27T06:16:53Z</updated>
<author>
<name>Glenn Strauss</name>
<email>gstrauss@gluelogic.com</email>
</author>
<published>2021-06-09T02:57:36Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/commit/?id=af3df29ae8276f4380ed25262bcdf3d95446a9b1'/>
<id>urn:sha1:af3df29ae8276f4380ed25262bcdf3d95446a9b1</id>
<content type='text'>
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-&gt;http_host and r-&gt;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-&gt;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-&gt;v.b))
  - address of buffer is arg (&amp;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-&gt;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
</content>
</entry>
<entry>
<title>[core] return entry from array_insert_data_at_pos</title>
<updated>2021-08-27T06:16:52Z</updated>
<author>
<name>Glenn Strauss</name>
<email>gstrauss@gluelogic.com</email>
</author>
<published>2021-05-23T02:30:17Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/commit/?id=41916b58de94f0b8d4d2028bc497884aa9914cfb'/>
<id>urn:sha1:41916b58de94f0b8d4d2028bc497884aa9914cfb</id>
<content type='text'>
(for convenience and to save a couple asm instructions)
</content>
</entry>
<entry>
<title>[core] make insert_dup an optional array method</title>
<updated>2021-08-27T06:16:52Z</updated>
<author>
<name>Glenn Strauss</name>
<email>gstrauss@gluelogic.com</email>
</author>
<published>2021-05-23T00:34:58Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/commit/?id=cc8e7107105989a5a1541643ecb2742c5257ede9'/>
<id>urn:sha1:cc8e7107105989a5a1541643ecb2742c5257ede9</id>
<content type='text'>
make insert_dup an optional array method in data_methods
(currently used only for merging strings of type data_string)
</content>
</entry>
<entry>
<title>[core] move data_{array,integer,string} to array.c</title>
<updated>2021-05-20T21:56:51Z</updated>
<author>
<name>Glenn Strauss</name>
<email>gstrauss@gluelogic.com</email>
</author>
<published>2021-05-20T20:58:53Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/commit/?id=4f8f83ea1d8fbabbc165fa45395a608d2ed6f5e5'/>
<id>urn:sha1:4f8f83ea1d8fbabbc165fa45395a608d2ed6f5e5</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>[core] consolidate config printing code</title>
<updated>2021-05-20T21:56:51Z</updated>
<author>
<name>Glenn Strauss</name>
<email>gstrauss@gluelogic.com</email>
</author>
<published>2021-05-20T05:18:57Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/lighttpd.git/commit/?id=fbe55825b417a71e9cced7f977cf5759ebf3bcb2'/>
<id>urn:sha1:fbe55825b417a71e9cced7f977cf5759ebf3bcb2</id>
<content type='text'>
funcs use only at startup and only for lighttpd -p
</content>
</entry>
</feed>
