<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/systemd.git/src/basic/mempool.c, branch main</title>
<subtitle>github.com: systemd/systemd.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/'/>
<entry>
<title>mempool: fix tile alignment check</title>
<updated>2023-02-24T13:11:31+00:00</updated>
<author>
<name>Lennart Poettering</name>
<email>lennart@poettering.net</email>
</author>
<published>2023-02-24T09:41:47+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/commit/?id=9b47b18a1a53ad7d8d579bdcd6ca5af84c401f4a'/>
<id>9b47b18a1a53ad7d8d579bdcd6ca5af84c401f4a</id>
<content type='text'>
We should check alignment *after* determining the pointer points into
our pool, not before. Otherwise might might end up checking alignment of
the pointer relative to our base, even though it is taken relative to
some other base.

Follow-up for: a2b052b29f8bc141e94a4af95d1653a38a57eaeb
See: https://github.com/systemd/systemd/pull/26393#issuecomment-1442295012
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We should check alignment *after* determining the pointer points into
our pool, not before. Otherwise might might end up checking alignment of
the pointer relative to our base, even though it is taken relative to
some other base.

Follow-up for: a2b052b29f8bc141e94a4af95d1653a38a57eaeb
See: https://github.com/systemd/systemd/pull/26393#issuecomment-1442295012
</pre>
</div>
</content>
</entry>
<entry>
<title>mempool: rework mempool_cleanup() to only release freed tiles</title>
<updated>2023-02-17T14:03:53+00:00</updated>
<author>
<name>Lennart Poettering</name>
<email>lennart@poettering.net</email>
</author>
<published>2023-02-14T12:44:51+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/commit/?id=a2b052b29f8bc141e94a4af95d1653a38a57eaeb'/>
<id>a2b052b29f8bc141e94a4af95d1653a38a57eaeb</id>
<content type='text'>
This substantially reworks mempool_cleanup() so that it releases pools
with all freed tiles only, but keeps all pools with still-allocated
tiles around.

This is more correct, as the previous implementation just released all
pools regardless if anything was still used or not. This would make
valgrind shut up but would just hide memory leaks altogether. Moreover
if called during regular runtime of a program would result in bad memory
accesses all over.

Hence, let's add a proper implementation and only trim pools we really
know are empty.

This way we can safely call these functions later, when under memory
pressure, at any time.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This substantially reworks mempool_cleanup() so that it releases pools
with all freed tiles only, but keeps all pools with still-allocated
tiles around.

This is more correct, as the previous implementation just released all
pools regardless if anything was still used or not. This would make
valgrind shut up but would just hide memory leaks altogether. Moreover
if called during regular runtime of a program would result in bad memory
accesses all over.

Hence, let's add a proper implementation and only trim pools we really
know are empty.

This way we can safely call these functions later, when under memory
pressure, at any time.
</pre>
</div>
</content>
</entry>
<entry>
<title>mempool: make mempool_free_tile() return NULL</title>
<updated>2023-02-17T14:03:10+00:00</updated>
<author>
<name>Lennart Poettering</name>
<email>lennart@poettering.net</email>
</author>
<published>2023-02-14T12:42:03+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/commit/?id=4392b983b8e765a25c7bf081c06e8ecc37425274'/>
<id>4392b983b8e765a25c7bf081c06e8ecc37425274</id>
<content type='text'>
To match how we usually do this current allocation code.

(Also, make it accept a NULL pointer, also in order to match behaviour
in the rest of our codebase)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To match how we usually do this current allocation code.

(Also, make it accept a NULL pointer, also in order to match behaviour
in the rest of our codebase)
</pre>
</div>
</content>
</entry>
<entry>
<title>mempool: introduce new helper pool_ptr()</title>
<updated>2023-02-17T14:02:18+00:00</updated>
<author>
<name>Lennart Poettering</name>
<email>lennart@poettering.net</email>
</author>
<published>2023-02-14T12:40:40+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/commit/?id=72381db942dd00f4d69b2d9a50156a62f2c350da'/>
<id>72381db942dd00f4d69b2d9a50156a62f2c350da</id>
<content type='text'>
This new helper returns the beginning of the usable area of the pool
object.

For now this is only used once, a later commit will use it more.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This new helper returns the beginning of the usable area of the pool
object.

For now this is only used once, a later commit will use it more.
</pre>
</div>
</content>
</entry>
<entry>
<title>mempool: rename local variable to match current coding style</title>
<updated>2023-02-17T14:01:36+00:00</updated>
<author>
<name>Lennart Poettering</name>
<email>lennart@poettering.net</email>
</author>
<published>2023-02-14T12:38:18+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/commit/?id=993a9314c494501f8d22c03cafda38ca17c3d40f'/>
<id>993a9314c494501f8d22c03cafda38ca17c3d40f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>hashmap: expose helper for releasing memory pools independently of valgrind</title>
<updated>2023-02-17T13:59:54+00:00</updated>
<author>
<name>Lennart Poettering</name>
<email>lennart@poettering.net</email>
</author>
<published>2023-02-08T17:03:27+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/commit/?id=9a0f0ef5576bd72c6908339df44bf382342266de'/>
<id>9a0f0ef5576bd72c6908339df44bf382342266de</id>
<content type='text'>
Let's clean this up and export this always, so that we can later call
when we are under memory pressure.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Let's clean this up and export this always, so that we can later call
when we are under memory pressure.
</pre>
</div>
</content>
</entry>
<entry>
<title>Turn mempool_enabled() into a weak symbol</title>
<updated>2022-06-29T14:51:52+00:00</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2022-06-12T14:52:57+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/commit/?id=b01f31954f1c7c4601925173ae2638b572224e9a'/>
<id>b01f31954f1c7c4601925173ae2638b572224e9a</id>
<content type='text'>
Before we had the following scheme:
mempool_enabled() would check mempool_use_allowed, and
libsystemd-shared would be linked with a .c file that provides mempool_use_allowed=true,
while other things would linked with a different .c file with mempool_use_allowed=false.

In the new scheme, mempool_enabled() itself is a weak symbol. If it's
not found, we assume false. So it only needs to be provided for libsystemd-shared,
where it can return false or true.

test-set-disable-mempool is libshared, so it gets the symbol. But then we
actually disable the mempool via envvar. mempool_enable() is called to check
its return value directly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before we had the following scheme:
mempool_enabled() would check mempool_use_allowed, and
libsystemd-shared would be linked with a .c file that provides mempool_use_allowed=true,
while other things would linked with a different .c file with mempool_use_allowed=false.

In the new scheme, mempool_enabled() itself is a weak symbol. If it's
not found, we assume false. So it only needs to be provided for libsystemd-shared,
where it can return false or true.

test-set-disable-mempool is libshared, so it gets the symbol. But then we
actually disable the mempool via envvar. mempool_enable() is called to check
its return value directly.
</pre>
</div>
</content>
</entry>
<entry>
<title>license: LGPL-2.1+ -&gt; LGPL-2.1-or-later</title>
<updated>2020-11-09T04:23:58+00:00</updated>
<author>
<name>Yu Watanabe</name>
<email>watanabe.yu+github@gmail.com</email>
</author>
<published>2020-11-09T04:23:58+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/commit/?id=db9ecf050165fd1033c6f81485917e229c4be537'/>
<id>db9ecf050165fd1033c6f81485917e229c4be537</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>util: split out memcmp()/memset() related calls into memory-util.[ch]</title>
<updated>2019-03-13T11:16:43+00:00</updated>
<author>
<name>Lennart Poettering</name>
<email>lennart@poettering.net</email>
</author>
<published>2019-03-13T11:02:21+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/commit/?id=0a9707187b7d7b02751b068336fa27757797d44c'/>
<id>0a9707187b7d7b02751b068336fa27757797d44c</id>
<content type='text'>
Just some source rearranging.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Just some source rearranging.
</pre>
</div>
</content>
</entry>
<entry>
<title>mempool: only enable mempool use when linked to libsystemd-shared.so</title>
<updated>2018-10-11T09:10:37+00:00</updated>
<author>
<name>Zbigniew Jędrzejewski-Szmek</name>
<email>zbyszek@in.waw.pl</email>
</author>
<published>2018-10-09T14:02:55+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/systemd.git/commit/?id=a5d8835c78112206bbf0812dd4cb471f803bfe88'/>
<id>a5d8835c78112206bbf0812dd4cb471f803bfe88</id>
<content type='text'>
Mempool use is enabled or disabled based on the mempool_use_allowed symbol that
is linked in.

Should fix assert crashes in external programs caused by #9792.
Replaces #10286.

v2:
- use two different source files instead of a gcc constructor
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Mempool use is enabled or disabled based on the mempool_use_allowed symbol that
is linked in.

Should fix assert crashes in external programs caused by #9792.
Replaces #10286.

v2:
- use two different source files instead of a gcc constructor
</pre>
</div>
</content>
</entry>
</feed>
