aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/utils.c
AgeCommit message (Collapse)Author
2015-03-19Merge branch 'egil/maps/hamt/OTP-12585'Björn-Egil Dahlberg
* egil/maps/hamt/OTP-12585: (113 commits) erts: Fix bug in ESTACK and WSTACK kernel: Add spec for erts_debug:map_info/1 mnesia: Update mnesia tests to reflect new ETS hash erts: Ensure maps uses _rel functions in halfword erts: Do not treat errors as fatal in erl_printf_term erts: Update preloaded erts_internal.beam erts: Add map decomposition wrappers erts: Ensure halfword has correct temp-heap for maps hipe: Handle separate hashmap tag correctly erts: Fix map bug in dec_term for 32-bit debug VM stdlib: Update qlc tests to reflect new ETS hash stdlib: Remove obsolete hashmap references in io_lib erts: Enhance maps ordering tests hipe: Fix maps sort order testcase erts: Remove unused variable in crashdump creation erts: Fix typo in copy_struct for halfword emulator erts: Restrict GCC intrinsics by compiler version erts: Fix windows bug in hashmap_info erts: Fix typo in make_hash2 for 32-bit arch Fix beam_load assert ... Conflicts: erts/emulator/beam/bif.tab
2015-03-18Merge branch 'maint'Zandra Hird
2015-03-12erts: Fix typo in make_hash2 for 32-bit archSverker Eriksson
2015-03-12erts: Cleanup comments for make_internal_hashSverker Eriksson
2015-03-12erts: Make hashmap iterator more flexibleSverker Eriksson
to allow mixing of 'next' and 'prev' operations.
2015-03-12erts: Refactor maps naming conventionSverker Eriksson
flatmap: Small map hashmap: Large map map: flatmap or hashmap
2015-03-12erts: Tweak over estimation of hashmap size for binary_to_termSverker Eriksson
Strategy: Calculate an over estimation of heap size that will give such a low probability for overflow, that "it will not happen". Scary assumption 1: Uniformly distributed hash values. Scary assumption 2: Tree size is normally distributed (right?)
2015-03-12erts: Fix erlang:hash and erlang:phash for hamtSverker Eriksson
by calling make_hash2.
2015-03-12erts: Fix compare order of hamt vs other typesSverker Eriksson
MAP_DEF and HASHMAP_DEF must have adjacent values
2015-03-12erts: Add make_internal_hashSverker Eriksson
2015-03-12erts: Make ESTACK usable through pointerBjörn-Egil Dahlberg
2015-03-12erts: Remove erl_hashmap.[ch] filesBjörn-Egil Dahlberg
2015-03-12erts: Refactor erl_hashmap header includesBjörn-Egil Dahlberg
2015-03-12erts: Change phash2 of maps to be sensitive to key-value combos.Sverker Eriksson
The old hashing did not care which value belonged to which key, for example: would hash the same.
2015-03-12erts: Add micro optimization to phash2 of tuplesSverker Eriksson
2015-03-12erts: Add hashing of hashmapsSverker Eriksson
2015-03-12erts: Make hashmap compare non-recursiveSverker Eriksson
2015-03-12erts: First recursive version of hashmap compareSverker Eriksson
2015-03-12erts: Change to total ordering of keys in small mapsSverker Eriksson
2015-03-12erts: Make WSTACK usable through pointerSverker Eriksson
2015-03-12erts: Add PSTACKSverker Eriksson
A lightweight stack that can be used to store any type. PUSH and POP return pointers into stack slots.
2015-03-12erts: Add RESERVE and FAST_PUSH for ESTACK & WSTACKSverker Eriksson
2015-03-12erts: Add matching of hashmapsSverker Eriksson
2015-02-21Fix make_hash descriptionWasif Malik
2014-12-10Merge branch 'maint'Rickard Green
* maint: Use the new 64-bit atomic ops API Introduce a 64-bit atomic ops API
2014-12-10Use the new 64-bit atomic ops APIRickard Green
2014-11-03Merge branch 'sverk/yielding-distr-send/OTP-12232'Sverker Eriksson
* sverk/yielding-distr-send/OTP-12232: erts: Add constant TERM_TO_BINARY_MEMCPY_FACTOR erts: Optimize some repeated calls to {E,W}STACK_PUSH erts: Yield in term_to_binary when encoding big maps erts: Remove unnecessary goto for fun encoding erts: Yield in term_to_binary while copying large binaries erts: Implement yielding for distributed send of large messages
2014-10-24erts: Make hipe_{un}reserve_beam_trap_frame INLINESverker Eriksson
2014-09-25Merge branch 'rickard/eager-check-io/OTP-12117' into ↵Rickard Green
rickard/maint-17/eager-check-io/OTP-12117 * rickard/eager-check-io/OTP-12117: Introduce support for eager check I/O scheduling Conflicts: erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_init.c erts/emulator/beam/erl_process.c erts/preloaded/ebin/erlang.beam
2014-09-25Introduce support for eager check I/O schedulingRickard Green
2014-08-29erts: Optimize some repeated calls to {E,W}STACK_PUSHSverker Eriksson
2014-08-06erts: Print error reason when malloc failsLukas Larsson
2014-05-22Make binary BIFs converting from lists yield on large inputRickard Green
- erlang:list_to_binary/1 - erlang:iolist_to_binary/1 - erlang:list_to_bitstring/1 - binary:list_to_bin/1
2014-02-27erts: Fix Map cmp exact equal of an empty mapBjörn-Egil Dahlberg
The expression, #{} =:= M where M was any Map, would always result in 'true'. This commit fixes this issue by first comparing sizes for both terms and then checking for size zero.
2014-02-24Merge branch 'lukas/ose/master/OTP-11334'Lukas Larsson
* lukas/ose/master/OTP-11334: (71 commits) erts: Fix unix efile assert ose: Use -O2 when building ose: Expand OSE docs ose: Add dummy ttsl driver ose: Cleanup cleanup of mutex selection defines ose: Polish mmap configure checks ose: Add ose specific x-compile flags ose: Updating fd_driver and spawn_driver for OSE ose: Updating event and signal API for OSE ose: Cleanup of mutex selection defines win32: Compile erl_log.exe ose: Remove uneccesary define ose: Fix ssl configure test for osx erts: Fix sys_msg_dispatcher assert ose: Fix broken doc links ose: Thread priorities configurable from lmconf ose: Yielding the cpu is done "the OSE" way ose: Start using ppdata for tse key ose: Do not use spinlocks on OSE ose: Fix support for crypto ... Conflicts: lib/crypto/c_src/crypto.c
2014-02-24Added support for ENEA OSELukas Larsson
This port has support for both non-smp and smp. It contains a new way to do io checking in which erts_poll_wait receives the payload of the polled entity. This has implications for all linked-in drivers.
2014-02-19beam/utils.c: Change back cmp() to only take two argumentsBjörn Gustavsson
Commit d5c238473b9cec819d93faaef4ccc00ddb60465f added a third argument to the cmp() function, but did not change the code generation of native code that called cmp(). Name the new functions with an "erts_" prefix, and reinstate the old cmp() function with two arguments. We don't have to keep a cmp() function in the halfword emulator, since HiPE does not support the halfword emulator.
2014-01-29erts: Add cmp_term to compareBjörn-Egil Dahlberg
Uses total order of types meaning int < float
2014-01-28erts: erlang:phash2 should hash Maps independent of orderBjörn-Egil Dahlberg
2014-01-28erts: Add Maps to erlang:phash/2 and erlang:hash/2Björn-Egil Dahlberg
The hashing a map in these functions uses the same strategy as the other terms. The exception being a prime number with size so we do not get erlang:phash(#{}) -> 1 which would be the same as erlang:phash({}) and erlang:phash(<<>>). Same argument for erlang:hash/1.
2014-01-28erts: Add phash2 Map functionalityBjörn-Egil Dahlberg
2014-01-28erts: Initial Map instructions, type and structureBjörn-Egil Dahlberg
2014-01-22erts: Fix crash when comparing very large floats with integersSverker Eriksson
big_buf was one word too short on 32-bit emulators causing memory corruption. Seems like this did not cause a problem before the ESTACK memory layout was changed in 172ebf11dc455e22b87f.
2014-01-22erts: Refactor big-float compare on HALFWORD to use C-stackSverker Eriksson
for the temporary conversion from float to big. Preparation for coming bugfix of 'big_buf' array size.
2014-01-17erts: Refactor ESTACK & WSTACK to use a struct easy to "export"Sverker Eriksson
This is not a clean refactor. It changes the behaviour slightly of E/WSTACK_RESTORE. The allocated stack from E/WSTACK_SAVE is used as-is and not copied into default_stack. This will hopefully fix an illusive memory leak that valgrind is reporting.
2014-01-15erts: Fix benign ESTACK/WSTACK typoSverker Eriksson
2013-12-07Merge branch 'rickard/garbage_collect/OTP-11388'Rickard Green
* rickard/garbage_collect/OTP-11388: Parallel check_process_code when code_server purge a module Functionality for disabling garbage collection Use asynchronous check_process_code in code_parallel_SUITE Execution of system tasks in context of another process Conflicts: bootstrap/lib/kernel/ebin/hipe_unified_loader.beam erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_internal.beam
2013-11-18Execution of system tasks in context of another processRickard Green
A process requesting a system task to be executed in the context of another process will be notified by a message when the task has executed. This message will be on the form: {RequestType, RequestId, Pid, Result}. A process requesting a system task to be executed can set priority on the system task. The requester typically set the same priority on the task as its own process priority, and by this avoiding priority inversion. A request for execution of a system task is made by calling the statically linked in NIF erts_internal:request_system_task(Pid, Prio, Request). This is an undocumented ERTS internal function that should remain so. It should *only* be called from BIF implementations. Currently defined system tasks are: * garbage_collect * check_process_code Further system tasks can and will be implemented in the future. The erlang:garbage_collect/[1,2] and erlang:check_process_code/[2,3] BIFs are now implemented using system tasks. Both the 'garbage_collect' and the 'check_process_code' operations perform or may perform garbage_collections. By doing these via the system task functionality all garbage collect operations in the system will be performed solely in the context of the process being garbage collected. This makes it possible to later implement functionality for disabling garbage collection of a process over context switches. Newly introduced BIFs: * erlang:garbage_collect/2 - The new second argument is an option list. Introduced option: * {async, RequestId} - making it possible for users to issue asynchronous garbage collect requests. * erlang:check_process_code/3 - The new third argument is an option list. Introduced options: * {async, RequestId} - making it possible for users to issue asynchronous check process code requests. * {allow_gc, boolean()} - making it possible to issue requests that aren't allowed to garbage collect (operation will abort if gc should be needed). These options have been introduced as a preparation for parallelization of check_process_code operations when the code_server is about to purge a module.
2013-10-16Merge branch 'sverk/load-nif-unicode'Sverker Eriksson
OTP-11408 * sverk/load-nif-unicode: erts: Fix bug in atom to filename conversions Fix open_ddll for win erts, crypto: Support NIF library with unicode filename on windows erts: Factor out erts_convert_filename_to_wchar() erts: Fix compiler warning erts: Fix loading of NIF library with unicode in path erts: Remove unused constant DRIVER_TAB_SIZE
2013-10-15Merge branch 'maint'Sverker Eriksson
Conflicts: erts/preloaded/ebin/erlang.beam