What is the story behind _SPI_PLAN_MAGIC?
Hi there,
Reading through the SPI code I see this definition:
#define _SPI_PLAN_MAGIC 569278163
Which is used in he _SPI_plan struct in src/include/executor/spi_priv.h:
typedef struct _SPI_plan
{
int magic;
...
}
What is its purpose?
Thank you.
Marcelo
Marcelo Fernandes <marcefern7@gmail.com> writes:
Reading through the SPI code I see this definition:
#define _SPI_PLAN_MAGIC 569278163
What is its purpose?
Just to catch programming errors, ie passing the wrong pointer
value to some SPI function. See the checks for it in spi.c.
regards, tom lane
On Mon, Feb 3, 2025 at 3:17 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Just to catch programming errors, ie passing the wrong pointer
value to some SPI function. See the checks for it in spi.c.
Aha! Perfect, I thought it was something like that. Thank you!
Marcelo.