[Asterisk-code-review] Astobj2: Add ao2 weakproxy ref object function. (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Wed Apr 29 11:22:59 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: Astobj2: Add ao2_weakproxy_ref_object function.
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/280/1/main/astobj2.c
File main/astobj2.c:

Line 845: 	if (weakproxy) {
Why make this function NULL tolerant for weakproxy?

The ao2_weakproxy_get_object() isn't tolerant.

Are you thinking of something like an ao2_weakproxy_object_cleanup()?


Line 855: 	if (delta >= 0 && !(flags & OBJ_NOLOCK)) {
I'm not seeing why you have an exception for delta < 0 to skip locking the weakproxy.  If you have a programming error that races to release the last real object ref you could have a hard to diagnose crash if internal->priv_data.weakptr is partially changed or what it points to becomes already freed.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I38a319b83314de75be74207a8771aab269bcca46
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list