* @class memNode * @brief Node in a hierarchical call tree accumulating memory statistics. * * Each node corresponds to a single function symbol (name pointer is used as key) * and contains aggregated malloc / free byte counts plus child nodes for deeper * call stack levels. */
| 437 | * call stack levels. |
| 438 | */ |
| 439 | class memNode |
| 440 | { |
| 441 | public: |
| 442 | /** @brief Default constructor creating an unnamed node. */ |
| 443 | MEM_NO_INSTRUMENT memNode() |
| 444 | { |
| 445 | } |
| 446 | |
| 447 | /** |
| 448 | * @brief Construct named node. |
| 449 | * @param name Function name associated with this node (pointer assumed stable) |
| 450 | */ |
| 451 | MEM_NO_INSTRUMENT memNode(const char *name) : _name(name) |
| 452 | { |
| 453 | } |
| 454 | |
| 455 | MEM_NO_INSTRUMENT ~memNode() |
| 456 | { |
| 457 | } |
| 458 | |
| 459 | MEM_NO_INSTRUMENT memNode(const memNode &o) |
| 460 | : _name(o._name), _childs(o._childs), _mallocBytes(o._mallocBytes), _freeBytes(o._freeBytes) |
| 461 | { |
| 462 | } |
| 463 | |
| 464 | MEM_NO_INSTRUMENT memNode(memNode &&o) noexcept |
| 465 | : _name(o._name), _childs(std::move(o._childs)), _mallocBytes(o._mallocBytes), _freeBytes(o._freeBytes) |
| 466 | { |
| 467 | } |
| 468 | |
| 469 | MEM_NO_INSTRUMENT memNode &operator=(const memNode &o) |
| 470 | { |
| 471 | if (this != &o) |
| 472 | { |
| 473 | _name = o._name; |
| 474 | _childs = o._childs; |
| 475 | _mallocBytes = o._mallocBytes; |
| 476 | _freeBytes = o._freeBytes; |
| 477 | } |
| 478 | return *this; |
| 479 | } |
| 480 | |
| 481 | MEM_NO_INSTRUMENT memNode &operator=(memNode &&o) noexcept |
| 482 | { |
| 483 | if (this != &o) |
| 484 | { |
| 485 | _name = o._name; |
| 486 | _childs = std::move(o._childs); |
| 487 | _mallocBytes = o._mallocBytes; |
| 488 | _freeBytes = o._freeBytes; |
| 489 | } |
| 490 | return *this; |
| 491 | } |
| 492 | |
| 493 | /** |
| 494 | * @brief Insert a memFrame into the tree along the provided call stack. |
| 495 | * @param callstack Null-terminated array of function name pointers. |
| 496 | * @param frame Frame data to merge. |
nothing calls this directly
no test coverage detected