mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
gslice: Use a convenience macro
In magazine_cache_trim(), use the recent G_APPROX_VALUE macro to decide
when to trim the magazine chain.
See <URL:fad04d2e18 (note_471824)
>.
This commit is contained in:
parent
9d43bfc4ed
commit
45a3598aa2
@ -640,10 +640,8 @@ magazine_cache_trim (Allocator *allocator,
|
|||||||
/* trim magazine cache from tail */
|
/* trim magazine cache from tail */
|
||||||
ChunkLink *current = magazine_chain_prev (allocator->magazines[ix]);
|
ChunkLink *current = magazine_chain_prev (allocator->magazines[ix]);
|
||||||
ChunkLink *trash = NULL;
|
ChunkLink *trash = NULL;
|
||||||
while ((stamp >= magazine_chain_uint_stamp (current) &&
|
while (!G_APPROX_VALUE(stamp, magazine_chain_uint_stamp (current),
|
||||||
stamp - magazine_chain_uint_stamp (current) >= allocator->config.working_set_msecs) ||
|
allocator->config.working_set_msecs))
|
||||||
(stamp <= magazine_chain_uint_stamp (current) &&
|
|
||||||
magazine_chain_uint_stamp (current) - stamp >= allocator->config.working_set_msecs))
|
|
||||||
{
|
{
|
||||||
/* unlink */
|
/* unlink */
|
||||||
ChunkLink *prev = magazine_chain_prev (current);
|
ChunkLink *prev = magazine_chain_prev (current);
|
||||||
|
Loading…
Reference in New Issue
Block a user