[sr-dev] [tracker] Comment added: Uninitialized $var returns 0 instead of <null>

sip-router admin at sip-router.org
Thu Jul 21 16:53:15 CEST 2011


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

The following task has a new comment added:

FS#141 - Uninitialized $var returns 0 instead of <null>
User who did this - Daniel-Constantin Mierla (miconda)

----------
The $var(x) and $shv(x) are defined at cfg parsing time and resolved to a pointer in pkg or shm, therefore very fast to access at runtime, while avps are kept in a dynamic list, searched by name every time at runtime.

If you think of C code, it's like:

int x;

 - x value cannot be null

Thus the var and shv are never null from this point of view. Also note that var and shv are not reset at all during runtime, their values persist.

What you can use is PV module parameters to set the init value to something that you know is the startup value.

Ultimately a flag could be used to mark as null value, but that might break existing things, without real new benefit comparing to a known value user as initial val.
----------

More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=141#comment243

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the sr-dev mailing list