[asterisk-dev] [Code Review] Create API for doing variable substitution with dynamic buffers

dimas at dataart.com dimas at dataart.com
Thu Apr 2 08:27:02 CDT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/174/#review674
-----------------------------------------------------------



/trunk/apps/app_minivm.c
<http://reviewboard.digium.com/r/174/#comment1766>

    (And this is one example of ast_free being called on potentially NULL string)



/trunk/apps/app_voicemail.c
<http://reviewboard.digium.com/r/174/#comment1764>

    The checks for individual strings being non-null seems redundant because there are other places where ast_free is called on potentially NULL string which is inconsistent.
    
    ast_free either allows NULLs o not. It seems it is mapped directly to free, which _should_ handle NULLs ok. However it can be platform dependent... But anyway it must be documented somewhere and the use must be consistent.
    
    



/trunk/apps/app_voicemail.c
<http://reviewboard.digium.com/r/174/#comment1765>

    Again...


- dimas


On 2009-04-01 15:44:57, Tilghman Lesher wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/174/
> -----------------------------------------------------------
> 
> (Updated 2009-04-01 15:44:57)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> We currently have a variable substitution system that depends upon static buffers.  This has issues, both because it takes up 12k of stack each time through nested variable expressions, but also because in some newer cases, the 4k limit on the size of the buffer is no longer sufficient.  So this is a conversion that allows us to use dynamic string buffers in place of the old static buffers.
> 
> Additionally, note that this is a subset of the changes done, to make review of the changes easier.
> 
> 
> Diffs
> -----
> 
>   /trunk/apps/app_exec.c 185911 
>   /trunk/apps/app_macro.c 185911 
>   /trunk/apps/app_minivm.c 185911 
>   /trunk/apps/app_voicemail.c 185911 
>   /trunk/cdr/cdr_custom.c 185911 
>   /trunk/funcs/func_aes.c 185911 
>   /trunk/funcs/func_base64.c 185911 
>   /trunk/funcs/func_blacklist.c 185911 
>   /trunk/funcs/func_callerid.c 185911 
>   /trunk/funcs/func_curl.c 185911 
>   /trunk/funcs/func_cut.c 185911 
>   /trunk/funcs/func_db.c 185911 
>   /trunk/funcs/func_dialplan.c 185911 
>   /trunk/funcs/func_env.c 185911 
>   /trunk/funcs/func_extstate.c 185911 
>   /trunk/funcs/func_groupcount.c 185911 
>   /trunk/funcs/func_lock.c 185911 
>   /trunk/funcs/func_logic.c 185911 
>   /trunk/funcs/func_md5.c 185911 
>   /trunk/funcs/func_module.c 185911 
>   /trunk/funcs/func_rand.c 185911 
>   /trunk/funcs/func_sha1.c 185911 
>   /trunk/funcs/func_speex.c 185911 
>   /trunk/funcs/func_strings.c 185911 
>   /trunk/funcs/func_sysinfo.c 185911 
>   /trunk/funcs/func_timeout.c 185911 
>   /trunk/funcs/func_vmcount.c 185911 
>   /trunk/include/asterisk/ast_expr.h 185911 
>   /trunk/include/asterisk/pbx.h 185912 
>   /trunk/main/ast_expr2f.c 185912 
>   /trunk/main/pbx.c 185911 
>   /trunk/main/strings.c 185912 
>   /trunk/res/res_agi.c 185911 
>   /trunk/res/res_config_curl.c 185911 
>   /trunk/res/res_phoneprov.c 185911 
> 
> Diff: http://reviewboard.digium.com/r/174/diff
> 
> 
> Testing
> -------
> 
> Extensive testing has been done on the new core API substitution call, and a module has been written to do testing of many places where functions have been written to take advantage of the new API.
> 
> 
> Thanks,
> 
> Tilghman
> 
>




More information about the asterisk-dev mailing list