forked from chakra-core/ChakraCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuxArray.h
More file actions
31 lines (27 loc) · 972 Bytes
/
AuxArray.h
File metadata and controls
31 lines (27 loc) · 972 Bytes
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
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once
namespace Js
{
template<typename T>
struct AuxArray
{
uint32 count;
T elements[];
AuxArray(uint32 count) : count(count)
{
}
static size_t OffsetOfElements() { return offsetof(AuxArray<T>, elements); }
void SetCount(uint count) { this->count = count; }
size_t GetDataSize() const { return sizeof(AuxArray) + sizeof(T) * count; }
};
typedef AuxArray<Var> VarArray;
struct FuncInfoEntry
{
uint nestedIndex;
uint scopeSlot;
};
typedef AuxArray<FuncInfoEntry> FuncInfoArray;
}