#ifdef USE_ASSERT_CHECKING
if (assert_enabled)
{
- int i;
+ int RefCountErrors = 0;
+ Buffer b;
- for (i = 0; i < NBuffers; i++)
+ for (b = 1; b <= NBuffers; b++)
{
- Assert(PrivateRefCount[i] == 0);
+ if (PrivateRefCount[b - 1] != 0)
+ {
+ PrintBufferLeakWarning(b);
+ RefCountErrors++;
+ }
}
+ Assert(RefCountErrors == 0);
}
#endif
#ifdef USE_ASSERT_CHECKING
if (assert_enabled)
{
- int i;
+ int RefCountErrors = 0;
+ Buffer b;
- for (i = 0; i < NBuffers; i++)
+ for (b = 1; b <= NBuffers; b++)
{
- Assert(PrivateRefCount[i] == 0);
+ if (PrivateRefCount[b - 1] != 0)
+ {
+ PrintBufferLeakWarning(b);
+ RefCountErrors++;
+ }
}
+ Assert(RefCountErrors == 0);
}
#endif
AtEOXact_LocalBuffers(bool isCommit)
{
#ifdef USE_ASSERT_CHECKING
- if (assert_enabled)
+ if (assert_enabled && LocalRefCount)
{
+ int RefCountErrors = 0;
int i;
for (i = 0; i < NLocBuffer; i++)
{
- Assert(LocalRefCount[i] == 0);
+ if (LocalRefCount[i] != 0)
+ {
+ Buffer b = -i - 1;
+
+ PrintBufferLeakWarning(b);
+ RefCountErrors++;
+ }
}
+ Assert(RefCountErrors == 0);
}
#endif
}
#ifdef USE_ASSERT_CHECKING
if (assert_enabled && LocalRefCount)
{
+ int RefCountErrors = 0;
int i;
for (i = 0; i < NLocBuffer; i++)
{
- Assert(LocalRefCount[i] == 0);
+ if (LocalRefCount[i] != 0)
+ {
+ Buffer b = -i - 1;
+
+ PrintBufferLeakWarning(b);
+ RefCountErrors++;
+ }
}
+ Assert(RefCountErrors == 0);
}
#endif
}