Should we move the resowner field from JitContext to LLVMJitContext?

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Should we move the resowner field from JitContext to LLVMJitContext?
Date: 2024-06-05 08:19:01
Message-ID: fd3a2a00-6605-4e30-a118-48418b478e6e@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I am implementing my own JIT plugin (based on Cranelift) for PostgreSQL
to learn more about the JIT and noticed an API change in PostgreSQL 17.

When Heikki made the resource owners extensible in commit
b8bff07daa85c837a2747b4d35cd5a27e73fb7b2 the API for JIT plugins changed
when ResourceOwnerForgetJIT() was moved from the generic JIT code to the
LLVM specific JIT code so now the resowner field of the context is only
used by the code of the LLVM plugin.

Maybe a bit late in the release cycle but should we make the resowner
field specific to the LLVM code too now that we already are breaking the
API? I personally do not like having a LLVM JIT specific field in the
common struct. Code is easier to understand if things are local. Granted
most JIT engines will likely need similar infrastructure but just
providing the struct field and nothing else does not seem very helpful.

See the attached patch.

Andreas

Attachment Content-Type Size
0001-Move-resowner-from-common-JitContext-to-LLVM-specifi.patch text/x-patch 2.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Long Song 2024-06-05 08:30:44 Re:Re: [PATCH]A minor improvement to the error-report in SimpleLruWriteAll()
Previous Message Ashutosh Bapat 2024-06-05 07:47:56 Re: Reuse child_relids in try_partitionwise_join was Re: Assert failure on bms_equal(child_joinrel->relids, child_joinrelids)