mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: Foam::name() of memory address
- returns the memory address formatted in hexadecimal, which can be useful for detailed information
This commit is contained in:
committed by
Andrew Heather
parent
3870b1d43c
commit
3c07a1bb6f
@ -50,7 +50,7 @@ Ostream& printInfo(const FixedList<List<T>, N>& list)
|
||||
Info<< list << " addresses:";
|
||||
for (unsigned i = 0; i < N; ++i)
|
||||
{
|
||||
Info<< " " << uintptr_t(list[i].cdata());
|
||||
Info<< ' ' << name(list[i].cdata());
|
||||
}
|
||||
Info<< nl;
|
||||
return Info;
|
||||
@ -211,7 +211,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Addresses don't change with swap
|
||||
Info<< "mem: "
|
||||
<< uintptr_t(list1.data()) << " " << uintptr_t(list2.data()) << nl;
|
||||
<< name(list1.data()) << " " << name(list2.data()) << nl;
|
||||
|
||||
list1.swap(list2);
|
||||
Info<< "The swap() method" << nl;
|
||||
@ -219,7 +219,7 @@ int main(int argc, char *argv[])
|
||||
<< "list2: " << list2 << nl;
|
||||
|
||||
Info<< "mem: "
|
||||
<< uintptr_t(list1.data()) << " " << uintptr_t(list2.data()) << nl;
|
||||
<< name(list1.data()) << " " << name(list2.data()) << nl;
|
||||
|
||||
Swap(list1, list2);
|
||||
Info<< "The Swap() function" << nl;
|
||||
@ -227,7 +227,7 @@ int main(int argc, char *argv[])
|
||||
<< "list2: " << list2 << nl;
|
||||
|
||||
Info<< "mem: "
|
||||
<< uintptr_t(list1.data()) << " " << uintptr_t(list2.data()) << nl;
|
||||
<< name(list1.data()) << " " << name(list2.data()) << nl;
|
||||
|
||||
Info<< "====" << nl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user