forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.cpp
More file actions
27 lines (21 loc) · 730 Bytes
/
Array.cpp
File metadata and controls
27 lines (21 loc) · 730 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
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "Array.h"
namespace hermes {
namespace unittest {
/// A virtual table for an array of HermesValue.
namespace {
void dummyFinalizer(GCCell *cell, GC *) {}
} // namespace
const VTable Array::vt{CellKind::FillerCellKind, 0, dummyFinalizer};
void ArrayBuildMeta(const GCCell *cell, Metadata::Builder &mb) {
const auto *self = static_cast<const Array *>(cell);
mb.addArray<Metadata::ArrayData::ArrayType::HermesValue>(
self->values(), &self->length, sizeof(GCHermesValue));
}
} // namespace unittest
} // namespace hermes