#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
34
36 for (
int i = 0;
i < 100;
i++)
37 {
40 }
41
42 for (
int i = 0;
i < 100;
i++)
43 {
45
49 }
50
51 for (
int i = 0;
i < 100;
i++)
52 {
54 }
55
57
59}
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_allocate(area, size)
#define dsa_create(tranch_id)
void LWLockRegisterTranche(int tranche_id, const char *tranche_name)
int LWLockNewTrancheId(void)
References a, buf, dsa_allocate, dsa_create, dsa_detach(), dsa_free(), dsa_get_address(), elog, ERROR, i, LWLockNewTrancheId(), LWLockRegisterTranche(), PG_RETURN_VOID, and snprintf.
◆ test_dsa_resowners()
Definition at line 64 of file test_dsa.c.
65{
66 int tranche_id;
71
72
75
76
78
79
80
81
82
86
87 for (
int i = 0;
i < 10000;
i++)
88 {
91 }
92
93
94 for (
int i = 0;
i < 500;
i++)
96
97
101 true, false);
104 true, false);
107 true, false);
109
111
113}
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(), LWLockRegisterTranche(), PG_RETURN_VOID, RESOURCE_RELEASE_AFTER_LOCKS, RESOURCE_RELEASE_BEFORE_LOCKS, RESOURCE_RELEASE_LOCKS, ResourceOwnerCreate(), ResourceOwnerDelete(), ResourceOwnerRelease(), and snprintf.
◆ PG_MODULE_MAGIC