| 458 | } |
| 459 | |
| 460 | uint64_t Structure::getSizeOf64() const { |
| 461 | if ( circularGuard ) return 1; |
| 462 | circularGuard = true; |
| 463 | uint64_t size = 0; |
| 464 | const Structure * cppLayoutParent = nullptr; |
| 465 | for ( const auto & fd : fields ) { |
| 466 | int fieldAlignemnt = fd.type->getAlignOf(); |
| 467 | int al = fieldAlignemnt - 1; |
| 468 | if ( cppLayout ) { |
| 469 | auto fp = findFieldParent(fd.name); |
| 470 | if ( fp!=cppLayoutParent ) { |
| 471 | if (DAS_NON_POD_PADDING || !cppLayoutNotPod) { |
| 472 | size = cppLayoutParent ? cppLayoutParent->getSizeOf64() : 0; |
| 473 | } |
| 474 | cppLayoutParent = fp; |
| 475 | } |
| 476 | } |
| 477 | size = (size + al) & ~al; |
| 478 | size += fd.type->getSizeOf64(); |
| 479 | } |
| 480 | circularGuard = false; |
| 481 | int al = getAlignOf() - 1; |
| 482 | size = (size + al) & ~al; |
| 483 | return size; |
| 484 | } |
| 485 | |
| 486 | uint64_t Structure::getSizeOf64(bool & failed) const { |
| 487 | if ( circularGuard ) return 1; |
no test coverage detected