ICU-7473 Make storage from MaybeStackArray have pointer alignment

X-SVN-Rev: 27723
This commit is contained in:
Andy Heninger 2010-02-27 18:10:23 +00:00
parent 3ded6f3da5
commit 9f3c015f3e

View File

@ -169,7 +169,7 @@ public:
/**
* Default constructor initializes with internal T[stackCapacity] buffer.
*/
MaybeStackArray() : ptr(stackArray), capacity(stackCapacity), needToRelease(FALSE) {}
MaybeStackArray() : needToRelease(FALSE), capacity(stackCapacity), ptr(stackArray) {}
/**
* Destructor deletes the array (if owned).
*/
@ -240,9 +240,9 @@ public:
*/
inline T *orphanOrClone(int32_t length, int32_t &resultCapacity);
private:
T *ptr;
int32_t capacity;
UBool needToRelease;
int32_t capacity;
T *ptr;
T stackArray[stackCapacity];
void releaseArray() {
if(needToRelease) {