Proposal for Prototype Implementation to Enhance C/C++ Interoperability in PostgreSQL - Mailing list pgsql-hackers

From 盏一
Subject Proposal for Prototype Implementation to Enhance C/C++ Interoperability in PostgreSQL
Date
Msg-id tencent_319A34A95B66D9B4396133AF@qq.com
Whole thread Raw
Responses Re: Proposal for Prototype Implementation to Enhance C/C++ Interoperability in PostgreSQL
List pgsql-hackers
Hi


I am writing to propose a prototype implementation that can greatly enhance the C/C++ interoperability in PostgreSQL. The implementation involves converting PG longjmp to [force unwind](https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html#base-throw), which triggers the destruction of local variables on the stack. Additionally, it converts throw statements that are not associated with catch to PG longjmp, thereby avoiding the call to terminate.


The proposed implementation can significantly improve the interoperability between C and C++ code in PostgreSQL. It allows for seamless integration of C++ code with PostgreSQL, without the need for complex workarounds or modifications to the existing codebase.


I have submitted the implementation on [GitHub](https://github.com/postgres/postgres/commit/1a9a2790430f256d9d0cc371249e43769d93eb8e#diff-6b6034caa00ddf38f641cbd10d5a5d1bb7135f8b23c5a879e9703bd11bd8240f). I would appreciate it if you could review the implementation and provide feedback.


Thank you for your time and consideration.


Best regards,

盏一----------


pgsql-hackers by date:

Previous
From: Erik Rijkers
Date:
Subject: Re: 2023-05-11 release announcement draft
Next
From: Yurii Rashkovskii
Date:
Subject: Re: [PATCH] Allow Postgres to pick an unused port to listen