ParameterNode impure usage

19 views
Skip to first unread message

Dimitry Sibiryakov

unread,
Jun 16, 2024, 12:05:12 PMJun 16
to firebir...@googlegroups.com
Hello All,

I see in code that ParameterNode::pass2() allocates in impure area either
impure_value or dsc and in ParameterNode::execute() these two possibilities are
handled accordingly.
At the same time in EVL_assign_to() the allocated memory is handled only as
impure_value. Taking into account that only vlu_desc is accessed there and this
field is the first, it may be safe enough.
But what is the reason for conditional allocation then? Wouldn't it to be
more robust to allocate impure_value or dsc always?

--
WBR, SD.

Adriano dos Santos Fernandes

unread,
Jun 17, 2024, 7:34:45 AMJun 17
to firebir...@googlegroups.com
On 16/06/2024 13:05, 'Dimitry Sibiryakov' via firebird-devel wrote:
>   Hello All,
>
>   I see in code that ParameterNode::pass2() allocates in impure area
> either impure_value or dsc and in ParameterNode::execute() these two
> possibilities are handled accordingly.
>   At the same time in EVL_assign_to() the allocated memory is handled
> only as impure_value. Taking into account that only vlu_desc is accessed
> there and this field is the first, it may be safe enough.

It's probably not the only place this assumption exists.


>   But what is the reason for conditional allocation then? Wouldn't it to
> be more robust to allocate impure_value or dsc always?
>

impure_value is large and necessary for parameters accessed in subroutines.

There is no reason to use more memory for all cases due to exceptional
cases.


Adriano

Dimitry Sibiryakov

unread,
Jun 17, 2024, 8:17:34 AMJun 17
to firebir...@googlegroups.com
Adriano dos Santos Fernandes wrote 17.06.2024 13:34:
> It's probably not the only place this assumption exists.

I've found no others. Every other descendant of ExprNode allocates
impure_value (or impure_value_ex) for impureOffset.

--
WBR, SD.

Reply all
Reply to author
Forward
0 new messages