Usage of memory pools during metadata cache object initialisation

32 views
Skip to first unread message

Dimitry Sibiryakov

unread,
Mar 2, 2026, 3:35:32 PM (13 days ago) Mar 2
to firebir...@googlegroups.com
Hello All,

In jrd_prc::scan() I see that parameter for the procedure are created not in
the same memory pool as jrd_prc instance itself but in the global metadata cache
pool, while the tree of nodes for default value - in the third, DBB's allocated
global pool, separate for each parameter.
And it looks like that on error only the pool for the last parameter is
destructed, probably leaking the rest.
Is there a reason why it is done this way instead of using the same pool for
everything, so on error everything is destructed at once with the pool itself?
AFAIR it was the idea behind memory pools.

--
WBR, SD.

Alex Peshkoff

unread,
Mar 3, 2026, 2:46:33 AM (12 days ago) Mar 3
to firebir...@googlegroups.com
Definitely should be fixed.


Dimitry Sibiryakov

unread,
Mar 3, 2026, 7:11:37 AM (12 days ago) Mar 3
to firebir...@googlegroups.com
Alex Peshkoff wrote 03.03.2026 8:46:
>> Is there a reason why it is done this way instead of using the same pool for
>> everything, so on error everything is destructed at once with the pool itself?
>> AFAIR it was the idea behind memory pools.
>>
>
> Definitely should be fixed.

If so, what pool must it be? I guess, a new one created with MetadataCache's
as a parent.

--
WBR, SD.

Alex Peshkoff

unread,
Mar 3, 2026, 7:45:36 AM (12 days ago) Mar 3
to firebir...@googlegroups.com
Yes, that appears to be correct.

James Starkey

unread,
Mar 3, 2026, 2:12:38 PM (12 days ago) Mar 3
to firebir...@googlegroups.com
You are correct in your assumption.

Jim Starkey


--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
---
You received this message because you are subscribed to the Google Groups "firebird-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/firebird-devel/90a6c84d-41e1-463e-9b74-061a351ea3d8%40gmail.com.

Dimitry Sibiryakov

unread,
Mar 3, 2026, 3:28:48 PM (12 days ago) Mar 3
to firebir...@googlegroups.com
Alex Peshkoff wrote 03.03.2026 13:45:
>>   If so, what pool must it be? I guess, a new one created with MetadataCache's
>> as a parent.
>
> Yes, that appears to be correct.

Unfortunately inter-references in "can-of-noodles" style make such
refactoring very complicated.

--
WBR, SD.
Reply all
Reply to author
Forward
0 new messages