astobj2: Add support for weakproxy objects.
authorCorey Farrell <git@cfware.com>
Sun, 12 Apr 2015 08:22:41 +0000 (04:22 -0400)
committerCorey Farrell <git@cfware.com>
Tue, 14 Apr 2015 01:19:20 +0000 (21:19 -0400)
commitcb6bf3094ed715817bcab9a1c951e49c730dd817
tree2ea1d113842c19dd7d833c63c23c78243e8b7358
parenta573b77f781e2d6722c00bc3376afd809760bfc3
astobj2: Add support for weakproxy objects.

This implements "weak" references.  The weakproxy object is a real ao2 with
normal reference counting of its own.  When a weakproxy is pointed to a normal
object they hold references to each other.  The normal object is automatically
freed when a single reference remains (the weakproxy).  The weakproxy also
supports subscriptions that will notify callbacks when it does not point
to any real object.

ASTERISK-24936 #close
Reported by: Corey Farrell

Change-Id: Ib9f73c02262488d314d9d9d62f58165b9ec43c67
include/asterisk/astobj2.h
main/astobj2.c
tests/test_astobj2_weaken.c [new file with mode: 0644]