| 479 | |
| 480 | template<class T> |
| 481 | forceinline T* |
| 482 | Heap::realloc(T* b, long unsigned int n, long unsigned int m) { |
| 483 | if (n == m) |
| 484 | return b; |
| 485 | T* p = static_cast<T*>(ralloc(sizeof(T)*m)); |
| 486 | for (long unsigned int i=0U; i<std::min(n,m); i++) |
| 487 | (void) new (p+i) T(b[i]); |
| 488 | for (long unsigned int i=n; i<m; i++) |
| 489 | (void) new (p+i) T(); |
| 490 | free<T>(b,n); |
| 491 | return p; |
| 492 | } |
| 493 | template<class T> |
| 494 | forceinline T* |
| 495 | Heap::realloc(T* b, long int n, long int m) { |