File tree 3 files changed +69
-0
lines changed
ReactCommon/fabric/mapbuffer
3 files changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* *
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #include " MapBuffer.h"
9
+
10
+ namespace facebook {
11
+ namespace react {
12
+
13
+ MapBuffer::MapBuffer () {}
14
+
15
+ MapBuffer::~MapBuffer () {}
16
+
17
+ } // namespace react
18
+ } // namespace facebook
Original file line number Diff line number Diff line change
1
+ /* *
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include < string>
11
+
12
+ namespace facebook {
13
+ namespace react {
14
+
15
+ /* *
16
+ * MapBuffer is an optimized map format for transferring data like props between
17
+ * C++ and other platforms The implemenation of this map is optimized to:
18
+ * - be compact to optimize space when sparse (sparse is the common case).
19
+ * - be accessible through JNI with zero/minimal copying via ByteBuffer.
20
+ * - be Have excellent C++ single-write and many-read performance by maximizing
21
+ * CPU cache performance through compactness, data locality, and fixed offsets
22
+ * where possible.
23
+ * - be optimized for iteration and intersection against other maps, but with
24
+ * reasonably good random access as well.
25
+ * - Work recursively for nested maps/arrays.
26
+ * - Supports dynamic types that map to JSON.
27
+ * - Don't require mutability - single-write on creation.
28
+ * - have minimal APK size and build time impact.
29
+ */
30
+ class MapBuffer {
31
+ public:
32
+ MapBuffer ();
33
+ virtual ~MapBuffer ();
34
+ };
35
+
36
+ } // namespace react
37
+ } // namespace facebook
Original file line number Diff line number Diff line change
1
+ /* *
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #include < memory>
9
+
10
+ #include < gtest/gtest.h>
11
+
12
+ TEST (MapBufferTest, testSomething) {
13
+ // TODO
14
+ }
You can’t perform that action at this time.
0 commit comments