|
27 | 27 | #include <ROOT/RSpan.hxx> |
28 | 28 |
|
29 | 29 | template<class Element> class TVectorT : public TObject { |
| 30 | +class TVectorT : public TObject { |
30 | 31 |
|
31 | 32 | protected: |
32 | | - Int_t fNrows{0}; // number of rows |
33 | | - Int_t fRowLwb{0}; // lower bound of the row index |
34 | | - Element *fElements{nullptr}; //[fNrows] elements themselves |
| 33 | + static constexpr Int_t kSizeMax = 5; // size data container on stack, see New_m(),Delete_m() |
| 34 | + static constexpr Int_t kWorkMax = 100; // size of work array's in several routines |
35 | 35 |
|
36 | | - enum {kSizeMax = 5}; // size data container on stack, see New_m(),Delete_m() |
37 | | - enum {kWorkMax = 100}; // size of work array's in several routines |
| 36 | + Element *fElements{nullptr}; // //[fNrows] elements themselves |
| 37 | + Int_t fNrows{0}; // number of rows |
| 38 | + Int_t fRowLwb{0}; // lower bound of the row index |
38 | 39 |
|
39 | | - Element fDataStack[kSizeMax]; //! data container |
40 | | - Bool_t fIsOwner{kTRUE}; //!default kTRUE, when Use array kFALSE |
| 40 | + Bool_t fIsOwner{kTRUE}; //! default kTRUE, when Use array kFALSE |
| 41 | + // 16-byte alignment is more than enough for double, __m128, __m256 |
| 42 | + alignas(16) Element fDataStack[kSizeMax]; //! data container |
41 | 43 |
|
42 | | - Element* New_m (Int_t size); |
43 | | - void Delete_m(Int_t size,Element*&); |
44 | | - Int_t Memcpy_m(Element *newp,const Element *oldp,Int_t copySize, |
45 | | - Int_t newSize,Int_t oldSize); |
46 | | - |
47 | | - void Allocate(Int_t nrows,Int_t row_lwb = 0,Int_t init = 0); |
| 44 | + Element *New_m(Int_t size); |
| 45 | + void Delete_m(Int_t size, Element *&ptr); |
| 46 | + Int_t Memcpy_m(Element *newp, const Element *oldp, Int_t copySize, Int_t newSize, Int_t oldSize); |
| 47 | + void Allocate(Int_t nrows, Int_t row_lwb = 0, Int_t init = 0); |
48 | 48 |
|
49 | 49 | enum EVectorStatusBits { |
50 | | - kStatus = BIT(14) // set if vector object is valid |
| 50 | + kStatus = BIT(14) // set if vector object is valid |
51 | 51 | }; |
52 | 52 |
|
53 | 53 | public: |
|
0 commit comments