forked from dolphinsmalltalk/DolphinVM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
STArray.h
43 lines (30 loc) · 1.06 KB
/
STArray.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/******************************************************************************
File: STArray.h
Description:
VM representation of Smalltalk Array class.
N.B. The representation of this class must NOT be changed.
******************************************************************************/
#ifndef _IST_STARRAY_H_
#define _IST_STARRAY_H_
#include "STCollection.h"
// Turn off warning about zero length arrays
#pragma warning ( disable : 4200)
class Array;
typedef TOTE<Array> ArrayOTE;
ostream& operator<<(ostream& st, const ArrayOTE* oteArray);
class Array : public ArrayedCollection
{
public:
Oop m_elements[]; // Variable length array of data
static ArrayOTE* New(unsigned size);
static ArrayOTE* NewUninitialized(unsigned size);
};
inline ArrayOTE* Array::New(unsigned size)
{
return reinterpret_cast<ArrayOTE*>(ObjectMemory::newPointerObject(Pointers.ClassArray, size));
}
inline ArrayOTE* Array::NewUninitialized(unsigned size)
{
return reinterpret_cast<ArrayOTE*>(ObjectMemory::newUninitializedPointerObject(Pointers.ClassArray, size));
}
#endif // EOF