Changeset 786
- Timestamp:
- May 29, 2003, 1:24:02 AM (18 years ago)
- Location:
- to-imperative/trunk/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
to-imperative/trunk/runtime/rf_expr.ih
r561 r786 558 558 // In a case of not flat expression advance reference counters for child 559 559 // memory blocks 560 if (!_expr.is_flat()) _expr.ref_childs();560 // if (!_expr.is_flat()) _expr.ref_childs(); 561 561 // 562 562 // Initialize expression by a copy of a first argument 563 563 Expr e(*this); 564 memcpy(e.last, _expr.first, len2 * sizeof(Term)); 564 // memcpy(e.last, _expr.first, len2 * sizeof(Term)); 565 if (_expr.is_flat()) 566 memcpy(e.last, _expr.first, len2 * sizeof(Term)); 567 else { 568 Term* to = e.last; 569 Term const* from = _expr.first; 570 while (from != _expr.last) { 571 new(to) Term(*from); 572 from++; to++; 573 } 574 } 565 575 // 566 576 // Adjust flags … … 580 590 lt_copy++; 581 591 #endif 582 if (!is_flat()) ref_childs();592 // if (!is_flat()) ref_childs(); 583 593 Expr e(_expr); 584 594 e.first -= len1; 585 memcpy(e.first, first, len1 * sizeof(Term)); 595 // memcpy(e.first, first, len1 * sizeof(Term)); 596 if (is_flat()) memcpy(e.first, first, len1 * sizeof(Term)); 597 else { 598 Term* to = e.first; 599 Term const* from = first; 600 while (from != last) { 601 new(to) Term(*from); 602 from++; to++; 603 } 604 } 586 605 e.flags &= flags; 587 606 return e; … … 600 619 // then for the resulting expression. This advances our chances to avoid 601 620 // some work in a case if at least one of two expressions is flat. 602 if (!is_flat()) ref_childs(); 603 if (!_expr.is_flat()) _expr.ref_childs(); 604 memcpy(e.first, first, len1 * sizeof(Term)); 605 memcpy(e.first + len1, _expr.first, len2 * sizeof(Term)); 621 if (is_flat()) memcpy(e.first, first, len1 * sizeof(Term)); 622 else { 623 Term* to = e.first; 624 Term const* from = first; 625 while (from != last) { 626 new(to) Term(*from); 627 from++; to++; 628 } 629 } 630 if (_expr.is_flat()) 631 memcpy(e.first + len1, _expr.first, len2 * sizeof(Term)); 632 else { 633 Term* to = e.first + len1; 634 Term const* from = _expr.first; 635 while (from != _expr.last) { 636 new(to) Term(*from); 637 from++; to++; 638 } 639 } 606 640 // 607 641 // Adjust flags -
to-imperative/trunk/runtime/rf_term.ih
r781 r786 70 70 inline Term::Term (Term const& _t) 71 71 { 72 (this->*ctor_funcs[ get_class()])(_t);72 (this->*ctor_funcs[_t.get_class()])(_t); 73 73 } 74 74 -
to-imperative/trunk/runtime/rf_word.cc
r731 r786 33 33 } 34 34 } 35 35 36 pxx::WString Word::to_string (uintptr_t _data) 37 { 38 Header* h = reinterpret_cast<Header*>(_data); 39 return pxx::WString(h->content, h->length); 40 } 41 36 42 Expr Word::create_expr (wchar_t const* _wstr) 37 43 { … … 81 87 Word::compare, 82 88 Word::hash, 83 null //Word::to_string89 Word::to_string 84 90 }; 85 91 -
to-imperative/trunk/runtime/rf_word.ih
r773 r786 232 232 } 233 233 #endif 234 234 235 } 235 236
Note: See TracChangeset
for help on using the changeset viewer.