JBoolean
JMemoryManager::RecordFilter::Match
	(
	const JMMRecord& record
	)
	const
{
	JBoolean match = kJTrue;

	if (!includeInternal && record.IsManagerMemory())
		{
		match = kJFalse;
		}

	if (record.GetSize() < minSize)
		{
		match = kJFalse;
		}

	const JSize newFileLength = strlen(record.GetNewFile());
	if (match && fileName != NULL && newFileLength == fileName->GetLength())
		{
		if (record.GetNewFile() != *fileName)
			{
			match = kJFalse;
			}
		}
	else if (match && fileName != NULL)
		{
		const JCharacter *s1, *s2;
		JSize l1, l2;
		if (newFileLength > fileName->GetLength())
			{
			s1 = record.GetNewFile();
			l1 = newFileLength;
			s2 = *fileName;
			l2 = fileName->GetLength();
			}
		else
			{
			s1 = *fileName;
			l1 = fileName->GetLength();
			s2 = record.GetNewFile();
			l2 = newFileLength;
			}

		if (*(s1 + l1 - l2 - 1) != ACE_DIRECTORY_SEPARATOR_CHAR ||
			strcmp(s1 + l1 - l2, s2) != 0)
			{
			match = kJFalse;
			}
		}

	return match;
}
void
JMMHashTable::PrintAllocated
(
    const JBoolean printInternal // = kJFalse
)
const
{
    cout << "\nAllocated block statistics:" << endl;

    cout << "\nAllocated user memory:" << endl;

    JConstHashCursor<JMMRecord> cursor(itsAllocatedTable);
    JSize totalSize = 0;
    while ( cursor.NextFull() )
    {
        const JMMRecord thisRecord = cursor.GetValue();
        if ( !thisRecord.IsManagerMemory() )
        {
            PrintAllocatedRecord(thisRecord);
            totalSize += thisRecord.GetSize();
        }
    }

    cout << "\nTotal allocated memory:  " << totalSize << " bytes" << endl;

    if (printInternal)
    {
        cout << "\nThe following blocks are probably owned by the memory manager"
             << "\nand *should* still be allocated--please report all cases of user"
             << "\nallocated memory showing up on this list!" << endl;

        cursor.Reset();
        while ( cursor.NextFull() )
        {
            const JMMRecord thisRecord = cursor.GetValue();
            if ( thisRecord.IsManagerMemory() )
            {
                PrintAllocatedRecord(thisRecord);
            }
        }
    }
}
void
JMMArrayTable::PrintAllocated
	(
	const JBoolean printInternal // = kJFalse
	)
	const
{
	cout << "\nAllocated block statistics:" << endl;

	cout << "\nAllocated user memory:" << endl;

	const JSize count = itsAllocatedTable->GetElementCount();
	for (JIndex i=1;i<=count;i++)
		{
		const JMMRecord thisRecord = itsAllocatedTable->GetElement(i);
		if ( !thisRecord.IsManagerMemory() )
			{
			PrintAllocatedRecord(thisRecord);
			}
		}

	if (printInternal)
		{
		cout << "\nThe following blocks are probably owned by the memory manager"
		     << "\nand *should* still be allocated--please report all cases of user"
		     << "\nallocated memory showing up on this list!" << endl;

		for (JIndex i=1;i<=count;i++)
			{
			const JMMRecord thisRecord = itsAllocatedTable->GetElement(i);
			if ( thisRecord.IsManagerMemory() )
				{
				PrintAllocatedRecord(thisRecord);
				}
			}
		}
}