Changeset 1589


Ignore:
Timestamp:
Oct 28, 2004, 4:57:12 AM (16 years ago)
Author:
orlov
Message:
  • New cleanup() method.

To be used for stack cleanup in catch construction when RFRT_STINGY_STACK isn't
defined.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/runtime/rf_stack.hh

    r1533 r1589  
    9696  inline void destroy_results (Expr* _saved_top)
    9797  {
    98     while (_saved_top < top) {
     98    while (top > _saved_top) {
    9999      top--;
    100100      D( printf("destroy_results: %p(%p,%p,%p)\n",
     
    109109    Expr* ress = top  - *(reinterpret_cast<uintptr_t*>(top));
    110110    Expr* args = ress - *(reinterpret_cast<uintptr_t*>(top) + 1);
    111     while (--top >= ress)
    112       top->~Expr();
     111    while (top > ress)
     112      (--top)->~Expr();
    113113    top = args;
     114  }
     115
     116  inline void cleanup (Expr* _saved_top)
     117  {
     118    while (top > _saved_top) {
     119      top--;
     120      Expr* ress = top  - *(reinterpret_cast<uintptr_t*>(top));
     121      Expr* args = ress - *(reinterpret_cast<uintptr_t*>(top) + 1);
     122      while (top > args)
     123        (--top)->~Expr();
     124    }
    114125  }
    115126
Note: See TracChangeset for help on using the changeset viewer.