@@ -172,7 +172,7 @@ MemoryContext CurTransactionContext = NULL;
172172
173173/* This is a transient link to the active portal's memory context: */
174174MemoryContext PortalContext = NULL ;
175- dsa_area * area = NULL ;
175+ dsa_area * MemoryStatsDsaArea = NULL ;
176176
177177static void MemoryContextDeleteOnly (MemoryContext context );
178178static void MemoryContextCallResetCallbacks (MemoryContext context );
@@ -1499,19 +1499,19 @@ ProcessGetMemoryContextInterrupt(void)
14991499
15001500MemoryContextSwitchTo (TopMemoryContext );
15011501
1502- area = dsa_create (memCxtArea -> lw_lock .tranche );
1502+ MemoryStatsDsaArea = dsa_create (memCxtArea -> lw_lock .tranche );
15031503
1504- handle = dsa_get_handle (area );
1504+ handle = dsa_get_handle (MemoryStatsDsaArea );
15051505MemoryContextSwitchTo (oldcontext );
15061506
1507- dsa_pin_mapping (area );
1507+ dsa_pin_mapping (MemoryStatsDsaArea );
15081508
15091509/*
15101510 * Pin the DSA area, this is to make sure the area remains attachable
15111511 * even if current backend exits. This is done so that the statistics
15121512 * are published even if the process exits while a client is waiting.
15131513 */
1514- dsa_pin (area );
1514+ dsa_pin (MemoryStatsDsaArea );
15151515
15161516/* Set the handle in shared memory */
15171517memCxtArea -> memstats_dsa_handle = handle ;
@@ -1521,14 +1521,14 @@ ProcessGetMemoryContextInterrupt(void)
15211521 * If DSA exists, created by another process publishing statistics, attach
15221522 * to it.
15231523 */
1524- else if (area == NULL )
1524+ else if (MemoryStatsDsaArea == NULL )
15251525{
15261526MemoryContext oldcontext = CurrentMemoryContext ;
15271527
15281528MemoryContextSwitchTo (TopMemoryContext );
1529- area = dsa_attach (memCxtArea -> memstats_dsa_handle );
1529+ MemoryStatsDsaArea = dsa_attach (memCxtArea -> memstats_dsa_handle );
15301530MemoryContextSwitchTo (oldcontext );
1531- dsa_pin_mapping (area );
1531+ dsa_pin_mapping (MemoryStatsDsaArea );
15321532}
15331533LWLockRelease (& memCxtArea -> lw_lock );
15341534
@@ -1545,7 +1545,7 @@ ProcessGetMemoryContextInterrupt(void)
15451545 * Free any previous allocations, free the name, ident and path
15461546 * pointers before freeing the pointer that contains them.
15471547 */
1548- free_memorycontextstate_dsa (area ,memCxtState [idx ].total_stats ,
1548+ free_memorycontextstate_dsa (MemoryStatsDsaArea ,memCxtState [idx ].total_stats ,
15491549memCxtState [idx ].memstats_dsa_pointer );
15501550}
15511551
@@ -1556,10 +1556,10 @@ ProcessGetMemoryContextInterrupt(void)
15561556 */
15571557memCxtState [idx ].total_stats = stats_num ;
15581558memCxtState [idx ].memstats_dsa_pointer =
1559- dsa_allocate0 (area ,stats_num * sizeof (MemoryStatsEntry ));
1559+ dsa_allocate0 (MemoryStatsDsaArea ,stats_num * sizeof (MemoryStatsEntry ));
15601560
15611561meminfo = (MemoryStatsEntry * )
1562- dsa_get_address (area ,memCxtState [idx ].memstats_dsa_pointer );
1562+ dsa_get_address (MemoryStatsDsaArea ,memCxtState [idx ].memstats_dsa_pointer );
15631563
15641564if (summary )
15651565{
@@ -1572,7 +1572,7 @@ ProcessGetMemoryContextInterrupt(void)
15721572& stat , true);
15731573path = lcons_int (1 ,path );
15741574PublishMemoryContext (meminfo ,cxt_id ,TopMemoryContext ,path ,stat ,
1575- 1 ,area ,100 );
1575+ 1 ,MemoryStatsDsaArea ,100 );
15761576cxt_id = cxt_id + 1 ;
15771577
15781578/*
@@ -1602,7 +1602,7 @@ ProcessGetMemoryContextInterrupt(void)
16021602 */
16031603memCxtState [idx ].total_stats = cxt_id ++ ;
16041604PublishMemoryContext (meminfo ,cxt_id ,c ,path ,
1605- grand_totals ,num_contexts ,area ,100 );
1605+ grand_totals ,num_contexts ,MemoryStatsDsaArea ,100 );
16061606}
16071607memCxtState [idx ].total_stats = cxt_id ;
16081608
@@ -1632,7 +1632,7 @@ ProcessGetMemoryContextInterrupt(void)
16321632if (context_id < (max_stats - 1 )|| stats_count <=max_stats )
16331633{
16341634/* 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 );
16361636}
16371637else
16381638{
@@ -1657,8 +1657,8 @@ ProcessGetMemoryContextInterrupt(void)
16571657int namelen = strlen ("Remaining Totals" );
16581658
16591659num_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 );
16621662strncpy (nameptr ,"Remaining Totals" ,namelen );
16631663meminfo [max_stats - 1 ].ident = InvalidDsaPointer ;
16641664meminfo [max_stats - 1 ].path = InvalidDsaPointer ;
@@ -1921,18 +1921,18 @@ AtProcExit_memstats_cleanup(int code, Datum arg)
19211921}
19221922
19231923/* 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 );
19261926
19271927/*
19281928 * Free the memory context statistics, free the name, ident and path
19291929 * pointers before freeing the pointer that contains these pointers and
19301930 * integer statistics.
19311931 */
1932- free_memorycontextstate_dsa (area ,memCxtState [idx ].total_stats ,
1932+ free_memorycontextstate_dsa (MemoryStatsDsaArea ,memCxtState [idx ].total_stats ,
19331933memCxtState [idx ].memstats_dsa_pointer );
19341934
1935- dsa_detach (area );
1935+ dsa_detach (MemoryStatsDsaArea );
19361936LWLockRelease (& memCxtState [idx ].lw_lock );
19371937}
19381938