[Asterisk-code-review] res sorcery memory cache: Add support for a full backend cache. (asterisk[13])

Mark Michelson asteriskteam at digium.com
Thu Dec 17 12:58:41 CST 2015


Mark Michelson has posted comments on this change.

Change subject: res_sorcery_memory_cache: Add support for a full backend cache.
......................................................................


Patch Set 4:

(2 comments)

https://gerrit.asterisk.org/#/c/1808/4/res/res_sorcery_memory_cache.c
File res/res_sorcery_memory_cache.c:

Line 729: 	if (cache->full_backend_cache && (front = ast_heap_peek(cache->object_heap, 1))) {
        : 		/* For a full backend cache all objects share the same lifetime */
        : 		cached_object->created = front->created;
        : 	}
Would it make sense to do this when allocating cached_object? You have the cache at the time that the cached object is being created, and that's when all other fields are initialized.

I'm not sure if the cached_object's "created" field is used any between allocation and adding to the cache, but if it is, then you'd get a false reading.


Line 1055: 		abort();
Why do you have an abort() call here? It seems like it may be on the harsh side. Aborting also makes the consequences not agree with what the comment says.


-- 
To view, visit https://gerrit.asterisk.org/1808
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie2993487e9c19de563413ad5561c7403b48caab5
Gerrit-PatchSet: 4
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list