@@ -172,7 +172,7 @@ MemoryContext CurTransactionContext = NULL;
172
172
173
173
/* This is a transient link to the active portal's memory context: */
174
174
MemoryContext PortalContext = NULL ;
175
- dsa_area * area = NULL ;
175
+ dsa_area * MemoryStatsDsaArea = NULL ;
176
176
177
177
static void MemoryContextDeleteOnly (MemoryContext context );
178
178
static void MemoryContextCallResetCallbacks (MemoryContext context );
@@ -1499,19 +1499,19 @@ ProcessGetMemoryContextInterrupt(void)
1499
1499
1500
1500
MemoryContextSwitchTo (TopMemoryContext );
1501
1501
1502
- area = dsa_create (memCxtArea -> lw_lock .tranche );
1502
+ MemoryStatsDsaArea = dsa_create (memCxtArea -> lw_lock .tranche );
1503
1503
1504
- handle = dsa_get_handle (area );
1504
+ handle = dsa_get_handle (MemoryStatsDsaArea );
1505
1505
MemoryContextSwitchTo (oldcontext );
1506
1506
1507
- dsa_pin_mapping (area );
1507
+ dsa_pin_mapping (MemoryStatsDsaArea );
1508
1508
1509
1509
/*
1510
1510
* Pin the DSA area, this is to make sure the area remains attachable
1511
1511
* even if current backend exits. This is done so that the statistics
1512
1512
* are published even if the process exits while a client is waiting.
1513
1513
*/
1514
- dsa_pin (area );
1514
+ dsa_pin (MemoryStatsDsaArea );
1515
1515
1516
1516
/* Set the handle in shared memory */
1517
1517
memCxtArea -> memstats_dsa_handle = handle ;
@@ -1521,14 +1521,14 @@ ProcessGetMemoryContextInterrupt(void)
1521
1521
* If DSA exists, created by another process publishing statistics, attach
1522
1522
* to it.
1523
1523
*/
1524
- else if (area == NULL )
1524
+ else if (MemoryStatsDsaArea == NULL )
1525
1525
{
1526
1526
MemoryContext oldcontext = CurrentMemoryContext ;
1527
1527
1528
1528
MemoryContextSwitchTo (TopMemoryContext );
1529
- area = dsa_attach (memCxtArea -> memstats_dsa_handle );
1529
+ MemoryStatsDsaArea = dsa_attach (memCxtArea -> memstats_dsa_handle );
1530
1530
MemoryContextSwitchTo (oldcontext );
1531
- dsa_pin_mapping (area );
1531
+ dsa_pin_mapping (MemoryStatsDsaArea );
1532
1532
}
1533
1533
LWLockRelease (& memCxtArea -> lw_lock );
1534
1534
@@ -1545,7 +1545,7 @@ ProcessGetMemoryContextInterrupt(void)
1545
1545
* Free any previous allocations, free the name, ident and path
1546
1546
* pointers before freeing the pointer that contains them.
1547
1547
*/
1548
- free_memorycontextstate_dsa (area , memCxtState [idx ].total_stats ,
1548
+ free_memorycontextstate_dsa (MemoryStatsDsaArea , memCxtState [idx ].total_stats ,
1549
1549
memCxtState [idx ].memstats_dsa_pointer );
1550
1550
}
1551
1551
@@ -1556,10 +1556,10 @@ ProcessGetMemoryContextInterrupt(void)
1556
1556
*/
1557
1557
memCxtState [idx ].total_stats = stats_num ;
1558
1558
memCxtState [idx ].memstats_dsa_pointer =
1559
- dsa_allocate0 (area , stats_num * sizeof (MemoryStatsEntry ));
1559
+ dsa_allocate0 (MemoryStatsDsaArea , stats_num * sizeof (MemoryStatsEntry ));
1560
1560
1561
1561
meminfo = (MemoryStatsEntry * )
1562
- dsa_get_address (area , memCxtState [idx ].memstats_dsa_pointer );
1562
+ dsa_get_address (MemoryStatsDsaArea , memCxtState [idx ].memstats_dsa_pointer );
1563
1563
1564
1564
if (summary )
1565
1565
{
@@ -1572,7 +1572,7 @@ ProcessGetMemoryContextInterrupt(void)
1572
1572
& stat , true);
1573
1573
path = lcons_int (1 , path );
1574
1574
PublishMemoryContext (meminfo , cxt_id , TopMemoryContext , path , stat ,
1575
- 1 , area , 100 );
1575
+ 1 , MemoryStatsDsaArea , 100 );
1576
1576
cxt_id = cxt_id + 1 ;
1577
1577
1578
1578
/*
@@ -1602,7 +1602,7 @@ ProcessGetMemoryContextInterrupt(void)
1602
1602
*/
1603
1603
memCxtState [idx ].total_stats = cxt_id ++ ;
1604
1604
PublishMemoryContext (meminfo , cxt_id , c , path ,
1605
- grand_totals , num_contexts , area , 100 );
1605
+ grand_totals , num_contexts , MemoryStatsDsaArea , 100 );
1606
1606
}
1607
1607
memCxtState [idx ].total_stats = cxt_id ;
1608
1608
@@ -1632,7 +1632,7 @@ ProcessGetMemoryContextInterrupt(void)
1632
1632
if (context_id < (max_stats - 1 ) || stats_count <= max_stats )
1633
1633
{
1634
1634
/* Copy statistics to DSA memory */
1635
- PublishMemoryContext (meminfo , context_id , cur , path , stat , 1 , area , 100 );
1635
+ PublishMemoryContext (meminfo , context_id , cur , path , stat , 1 , MemoryStatsDsaArea , 100 );
1636
1636
}
1637
1637
else
1638
1638
{
@@ -1657,8 +1657,8 @@ ProcessGetMemoryContextInterrupt(void)
1657
1657
int namelen = strlen ("Remaining Totals" );
1658
1658
1659
1659
num_individual_stats = context_id + 1 ;
1660
- meminfo [max_stats - 1 ].name = dsa_allocate (area , namelen + 1 );
1661
- nameptr = dsa_get_address (area , meminfo [max_stats - 1 ].name );
1660
+ meminfo [max_stats - 1 ].name = dsa_allocate (MemoryStatsDsaArea , namelen + 1 );
1661
+ nameptr = dsa_get_address (MemoryStatsDsaArea , meminfo [max_stats - 1 ].name );
1662
1662
strncpy (nameptr , "Remaining Totals" , namelen );
1663
1663
meminfo [max_stats - 1 ].ident = InvalidDsaPointer ;
1664
1664
meminfo [max_stats - 1 ].path = InvalidDsaPointer ;
@@ -1921,18 +1921,18 @@ AtProcExit_memstats_cleanup(int code, Datum arg)
1921
1921
}
1922
1922
1923
1923
/* If the dsa mapping could not be found, attach to the area */
1924
- if (area == NULL )
1925
- area = dsa_attach (memCxtArea -> memstats_dsa_handle );
1924
+ if (MemoryStatsDsaArea == NULL )
1925
+ MemoryStatsDsaArea = dsa_attach (memCxtArea -> memstats_dsa_handle );
1926
1926
1927
1927
/*
1928
1928
* Free the memory context statistics, free the name, ident and path
1929
1929
* pointers before freeing the pointer that contains these pointers and
1930
1930
* integer statistics.
1931
1931
*/
1932
- free_memorycontextstate_dsa (area , memCxtState [idx ].total_stats ,
1932
+ free_memorycontextstate_dsa (MemoryStatsDsaArea , memCxtState [idx ].total_stats ,
1933
1933
memCxtState [idx ].memstats_dsa_pointer );
1934
1934
1935
- dsa_detach (area );
1935
+ dsa_detach (MemoryStatsDsaArea );
1936
1936
LWLockRelease (& memCxtState [idx ].lw_lock );
1937
1937
}
1938
1938
0 commit comments