| 569 | } |
| 570 | |
| 571 | bool Savepoint::isLarge() const |
| 572 | { |
| 573 | // Returns whether the current savepoint is large enough (has many verbs posted). |
| 574 | // |
| 575 | // Notes: |
| 576 | // |
| 577 | // - This routine does not take into account the data allocated to 'vct_undo'. |
| 578 | // Why? Because this routine is used to estimate size of transaction-level |
| 579 | // savepoint and transaction-level savepoint may not contain undo data as it is |
| 580 | // always the first savepoint in transaction. |
| 581 | // |
| 582 | // - We use U_IPTR, not ULONG to care of case when user savepoint gets very, |
| 583 | // very big on 64-bit machine. Its size may overflow 32 significant bits of |
| 584 | // ULONG in this case |
| 585 | |
| 586 | U_IPTR size = 0; |
| 587 | |
| 588 | // Iterate all tables changed under this savepoint |
| 589 | |
| 590 | for (VerbAction* action = m_actions; action; action = action->vct_next) |
| 591 | { |
| 592 | // Estimate size used for record backout bitmaps for this table |
| 593 | |
| 594 | if (action->vct_records) |
| 595 | { |
| 596 | size += action->vct_records->approxSize(); |
| 597 | |
| 598 | if (size > SIZE_THRESHOLD) |
| 599 | return true; |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | return false; |
| 604 | } |
| 605 | |
| 606 | Savepoint* Savepoint::release(Savepoint* prior) |
| 607 | { |