Changeset 290


Ignore:
Timestamp:
Dec 20, 2002, 10:17:35 PM (18 years ago)
Author:
orlov
Message:

* empty log message *

Location:
to-imperative/branches/may_move_heap/runtime
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/branches/may_move_heap/runtime/pxx_common.hh

    r160 r290  
    2121#endif
    2222
    23 #define MAY_MOVE_HEAP 1
    24 #define HEAP_IS_ALIGNED 0
     23#define MAY_MOVE_HEAP 0
     24#define HEAP_IS_ALIGNED 1
    2525
    2626#define null (0)
  • to-imperative/branches/may_move_heap/runtime/pxx_heap_allocator.hh

    r159 r290  
    253253  {
    254254    MemoryBlock *q = ptr_add( this, offset );
    255     size_t size = q->size;
    256     if( size & (size - 1) )
     255    size_t sz = q->size;
     256    if( sz & (sz - 1) )
    257257    {
    258       size = rounds[((T*)q)->get_order()];
    259       printf( "a(%p):%u ", q, size );
     258      sz = rounds[((T*)q)->get_order()];
     259      printf( "a(%p):%u ", q, sz );
    260260    }
    261261    else
    262262    {
    263       printf( "f(%p):%u ", q, size );
     263      printf( "f(%p):%u ", q, sz );
    264264    }
    265     if( !size )
     265    if( !sz )
    266266    {
    267267      printf( "...block orders are corrupted..." );
    268268      break;
    269269    }
    270     offset += size;
     270    offset += sz;
    271271  }
    272272  printf( "\n\n" );
  • to-imperative/branches/may_move_heap/runtime/rf_expr.hh

    r160 r290  
    697697
    698698friend
    699 inline bool fast_eq (
    700   Term_Ptr _f1, Term_Ptr _l1, Term_Ptr _f2, Term_Ptr _l2
     699inline bool eq_expr (
     700  const Expr &_e1, uintptr_t _pos1, uintptr_t _len1,
     701  const Expr &_e2, uintptr_t _pos2, uintptr_t _len2
    701702)
    702703{
    703   for (; _f1 < _l1; _f1++, _f2++) {
    704     if (_f1->get_type() != _f2->get_type() || _f1->data2 != _f2->data2)
     704  if (_len1 == _len2) {
     705    Term_Ptr p1 = _e1.get_first() + _pos1;
     706    Term_Ptr p2 = _e2.get_first() + _pos2;
     707    Term_Ptr l1 = p1  + _len1;
     708    for (; p1 < l1; p1++, p2++) {
     709      if (*p1 != *p2) return false;
     710    }
     711    return true;
     712  }
     713  return false;
     714}
     715
     716friend
     717inline bool flat_eq (
     718  const Expr &_e1, uintptr_t _pos1,
     719  const Expr &_e2, uintptr_t _pos2, uintptr_t _len
     720)
     721{
     722  Term_Ptr p1 = _e1.get_first() + _pos1;
     723  Term_Ptr p2 = _e2.get_first() + _pos2;
     724  Term_Ptr l1 = p1  + _len;
     725  for (; p1 < l1; p1++, p2++) {
     726    if (p1->get_type() != p2->get_type() || p1->data2 != p2->data2)
    705727      return false;
    706728  }
  • to-imperative/branches/may_move_heap/runtime/rf_macros.hh

    r147 r290  
    7474  return __saved_top
    7575
     76#define RF_DECL(f) \
     77  extern "C" RetVal rf_##f (void)
     78
    7679#define func_decl(f) \
    7780  extern "C" RetVal rf_##f ()
  • to-imperative/branches/may_move_heap/runtime/rf_term.hh

    r158 r290  
    6868friend inline Expr operator + (Term const&, Term const&) ;
    6969friend inline bool operator == (Term const&, Term const&) ;
    70 friend inline bool fast_eq (
    71                 Term_Ptr _f1, Term_Ptr _l1, Term_Ptr _f2, Term_Ptr _l2) ;
     70friend inline bool flat_eq (
     71    const Expr &_e1, uintptr_t _pos1,
     72    const Expr &_e2, uintptr_t _pos2, uintptr_t _len );
    7273
    7374private:
Note: See TracChangeset for help on using the changeset viewer.