#include "postgres.h"
#include "fmgr.h"
#include "storage/lwlock.h"
#include "utils/dsa.h"
#include "utils/resowner.h"
Go to the source code of this file.
◆ PG_FUNCTION_INFO_V1() [1/2]
◆ PG_FUNCTION_INFO_V1() [2/2]
◆ test_dsa_basic()
Definition at line 25 of file test_dsa.c.
26{
27 int tranche_id;
30
31
33
35 for (
int i = 0;
i < 100;
i++)
36 {
39 }
40
41 for (
int i = 0;
i < 100;
i++)
42 {
44
48 }
49
50 for (
int i = 0;
i < 100;
i++)
51 {
53 }
54
56
58}
void * dsa_get_address(dsa_area *area, dsa_pointer dp)
void dsa_detach(dsa_area *area)
void dsa_free(dsa_area *area, dsa_pointer dp)
#define dsa_create(tranche_id)
#define dsa_allocate(area, size)
int LWLockNewTrancheId(const char *name)
References a, buf, dsa_allocate, dsa_create, dsa_detach(), dsa_free(), dsa_get_address(), elog, ERROR, i, LWLockNewTrancheId(), PG_RETURN_VOID, and snprintf.
◆ test_dsa_resowners()
Definition at line 63 of file test_dsa.c.
64{
65 int tranche_id;
70
71
73
74
76
77
78
79
80
84
85 for (
int i = 0;
i < 10000;
i++)
86 {
89 }
90
91
92 for (
int i = 0;
i < 500;
i++)
94
95
99 true, false);
102 true, false);
105 true, false);
107
109
111}
ResourceOwner ResourceOwnerCreate(ResourceOwner parent, const char *name)
ResourceOwner CurrentResourceOwner
void ResourceOwnerRelease(ResourceOwner owner, ResourceReleasePhase phase, bool isCommit, bool isTopLevel)
void ResourceOwnerDelete(ResourceOwner owner)
@ RESOURCE_RELEASE_BEFORE_LOCKS
@ RESOURCE_RELEASE_AFTER_LOCKS
References a, CurrentResourceOwner, dsa_allocate, dsa_create, dsa_detach(), dsa_free(), dsa_get_address(), i, LWLockNewTrancheId(), PG_RETURN_VOID, RESOURCE_RELEASE_AFTER_LOCKS, RESOURCE_RELEASE_BEFORE_LOCKS, RESOURCE_RELEASE_LOCKS, ResourceOwnerCreate(), ResourceOwnerDelete(), ResourceOwnerRelease(), and snprintf.
◆ PG_MODULE_MAGIC