[Asterisk-code-review] res sorcery memory cache: Add support for object lifetime ma... (asterisk[master])

Joshua Colp asteriskteam at digium.com
Thu May 21 13:25:35 CDT 2015


Hello Mark Michelson,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/499

to look at the new patch set (#2).

Change subject: res_sorcery_memory_cache: Add support for object_lifetime_maximum.
......................................................................

res_sorcery_memory_cache: Add support for object_lifetime_maximum.

This makes the "object_lifetime_maximum" option operational.

On the addition of an object to an empty memory cache a scheduled
task is created which, when invoked, expires objects from the cache
which have exceeded their lifetime. If more objects have been added
the remaining life of the oldest object is used to schedule the
next invocation of the scheduled task.

If the oldest object is removed from the cache before it can be
expired automatically the scheduled task is cancelled, if possible,
and the lifetime of the next oldest is used to schedule the task.

If during these two operations no additional objects exist in the
cache then no task is scheduled.

An additional unit test has been added which verifies this
functionality.

ASTERISK-25067
Reported by: Matt Jordan

Change-Id: I87409674674a508e7717ee20739ca15cec6ba7b6
---
M res/res_sorcery_memory_cache.c
1 file changed, 241 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/99/499/2
-- 
To view, visit https://gerrit.asterisk.org/499
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I87409674674a508e7717ee20739ca15cec6ba7b6
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list