Improved readability [skip ci]

This commit is contained in:
Andrew Kane
2023-12-22 16:39:13 -05:00
parent 569c69580a
commit 1e422cd62b

View File

@@ -263,13 +263,13 @@ CreateNeighborPages(HnswBuildState * buildstate)
pfree(ntup); pfree(ntup);
} }
#ifdef HNSW_MEMORY
/* /*
* Show memory usage * Show memory usage
*/ */
static void static void
ShowMemoryUsage(HnswBuildState * buildstate) ShowMemoryUsage(HnswBuildState * buildstate)
{ {
#ifdef HNSW_MEMORY
#if PG_VERSION_NUM >= 130000 #if PG_VERSION_NUM >= 130000
elog(INFO, "graph memory: %zu MB, total memory: %zu MB", elog(INFO, "graph memory: %zu MB, total memory: %zu MB",
MemoryContextMemAllocated(buildstate->graphCtx, false) / (1024 * 1024), MemoryContextMemAllocated(buildstate->graphCtx, false) / (1024 * 1024),
@@ -278,8 +278,8 @@ ShowMemoryUsage(HnswBuildState * buildstate)
MemoryContextStats(CurrentMemoryContext); MemoryContextStats(CurrentMemoryContext);
elog(INFO, "estimated memory: %zu MB", buildstate->memoryUsed / (1024 * 1024)); elog(INFO, "estimated memory: %zu MB", buildstate->memoryUsed / (1024 * 1024));
#endif #endif
#endif
} }
#endif
/* /*
* Flush pages * Flush pages
@@ -287,7 +287,9 @@ ShowMemoryUsage(HnswBuildState * buildstate)
static void static void
FlushPages(HnswBuildState * buildstate) FlushPages(HnswBuildState * buildstate)
{ {
#ifdef HNSW_MEMORY
ShowMemoryUsage(buildstate); ShowMemoryUsage(buildstate);
#endif
CreateMetaPage(buildstate); CreateMetaPage(buildstate);
CreateElementPages(buildstate); CreateElementPages(buildstate);