-
- Downloads
Make sorcery details opaque and add extended fields.
Sorcery specific object information is now opaque and allocated with the object. This means that modules do not need to be recompiled if the sorcery specific part is changed. It also means that sorcery can store additional information on objects and ensure it is freed or the reference count decreased when the object goes away. To facilitate the above a generic sorcery allocator function has been added which also ensures that allocated objects do not have a lock. Extended fields have been added thanks to all of the above which allows specific fields to be marked as extended, and thus simply stored as-is within the object. Type safety is *NOT* enforced on these fields. A consumer of them has to query and ultimately perform their own safety check. What does this mean? Extra modules can extend already defined structures without having to modify them. Tests have also been included to verify extended field functionality. Review: https://reviewboard.asterisk.org/r/2585/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@392586 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Showing
- include/asterisk/sorcery.h 44 additions, 5 deletionsinclude/asterisk/sorcery.h
- main/sorcery.c 120 additions, 16 deletionsmain/sorcery.c
- res/res_sip/config_auth.c 1 addition, 1 deletionres/res_sip/config_auth.c
- res/res_sip/config_domain_aliases.c 1 addition, 1 deletionres/res_sip/config_domain_aliases.c
- res/res_sip/config_transport.c 1 addition, 1 deletionres/res_sip/config_transport.c
- res/res_sip/location.c 2 additions, 2 deletionsres/res_sip/location.c
- res/res_sip/sip_configuration.c 2 additions, 2 deletionsres/res_sip/sip_configuration.c
- res/res_sip/sip_options.c 1 addition, 2 deletionsres/res_sip/sip_options.c
- tests/test_sorcery.c 68 additions, 1 deletiontests/test_sorcery.c
Loading
Please register or sign in to comment