aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/global.h
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-07-26 10:19:31 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-08-01 10:58:59 +0200
commita2359927ca4e7c315e9849deec3375b1f2ae4170 (patch)
tree02858a93132a7da7acbd1487877259f63955445c /erts/emulator/beam/global.h
parent8d4560198239256587ccc55895eb8fe2b214e971 (diff)
downloadotp-a2359927ca4e7c315e9849deec3375b1f2ae4170.tar.gz
otp-a2359927ca4e7c315e9849deec3375b1f2ae4170.tar.bz2
otp-a2359927ca4e7c315e9849deec3375b1f2ae4170.zip
erts: Remove the need for copying of literals
* Literals are not copied between processes for messages or spawn Increases performance of message sent and processes spawned when literals are involved in messages or arguments.
Diffstat (limited to 'erts/emulator/beam/global.h')
-rw-r--r--erts/emulator/beam/global.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/erts/emulator/beam/global.h b/erts/emulator/beam/global.h
index bf2e50e52f..67ce0d0723 100644
--- a/erts/emulator/beam/global.h
+++ b/erts/emulator/beam/global.h
@@ -1085,8 +1085,8 @@ typedef struct {
Eterm* shtable_start;
ErtsAlcType_t shtable_alloc_type;
Uint literal_size;
- Eterm *range_ptr;
- Uint range_sz;
+ Eterm *lit_purge_ptr;
+ Uint lit_purge_sz;
} erts_shcopy_t;
#define INITIALIZE_SHCOPY(info) \
@@ -1095,8 +1095,8 @@ do { \
info.bitstore_start = info.bitstore_default; \
info.shtable_start = info.shtable_default; \
info.literal_size = 0; \
- info.range_ptr = erts_clrange.ptr; \
- info.range_sz = erts_clrange.sz; \
+ info.lit_purge_ptr = erts_clrange.ptr; \
+ info.lit_purge_sz = erts_clrange.sz; \
} while(0)
#define DESTROY_SHCOPY(info) \
@@ -1116,15 +1116,21 @@ do { \
Eterm copy_object_x(Eterm, Process*, Uint);
#define copy_object(Term, Proc) copy_object_x(Term,Proc,0)
-Uint size_object(Eterm);
+Uint size_object_x(Eterm,Eterm*,Uint,Uint);
+#define size_object(Term) size_object_x(Term,NULL,0,0)
+#define size_object_litopt(Term,LitPtr,LitSz) size_object_x(Term,LitPtr,LitSz,1)
+
Uint copy_shared_calculate(Eterm, erts_shcopy_t*);
Eterm copy_shared_perform(Eterm, Uint, erts_shcopy_t*, Eterm**, ErlOffHeap*);
Uint size_shared(Eterm);
-Eterm copy_struct_x(Eterm, Uint, Eterm**, ErlOffHeap*, Uint* bsz);
+Eterm copy_struct_x(Eterm, Uint, Eterm**, ErlOffHeap*, Uint* bsz, Eterm *lit_ptr, Uint lit_sz, Uint litopt);
#define copy_struct(Obj,Sz,HPP,OH) \
- copy_struct_x(Obj,Sz,HPP,OH,NULL)
+ copy_struct_x(Obj,Sz,HPP,OH,NULL,NULL,0,0)
+#define copy_struct_litopt(Obj,Sz,HPP,OH,LitPtr,LitSz) \
+ copy_struct_x(Obj,Sz,HPP,OH,NULL,LitPtr,LitSz,1)
+
Eterm copy_shallow(Eterm*, Uint, Eterm**, ErlOffHeap*);
void erts_move_multi_frags(Eterm** hpp, ErlOffHeap*, ErlHeapFragment* first,