summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/binary.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright yearRickard Green2021-12-161-1/+1
|
* Fix typos in erts/emulator/beamKian-Meng, Ang2021-11-301-2/+2
|
* erts: Keep literal lists in the line tableJohn Högberg2021-10-221-1/+1
| | | | | | | | | This saves us from having to convert them to lists on the fly at runtime, which is extremely annoying because of the special case for "module_name.erl" This also means that file paths can be arbitrarily long in the future.
* erts: Statically allocate trap export entries againJohn Högberg2020-11-131-4/+4
| | | | | Now that we no longer execute code inside them, they no longer need to be allocated at runtime.
* otp: Remove HiPE and HiPE-related accessoriesJohn Högberg2020-11-091-14/+0
|
* jit: Make all code read-only, dual-mapping writable pagesJohn Högberg2020-11-051-1/+1
| | | | | | | | This allows the JIT to be used on systems that enforce a W^X policy. To help catch related errors at compile time, all code pointers have been marked `const`.
* erts: Implement the BeamAsm JITLukas Larsson2020-09-221-0/+4
| | | | | | Co-authored-by: John Högberg <john@erlang.org> Co-authored-by: Dan Gudmundsson <dgud@erlang.org> Co-authored-by: Björn Gustavsson <bjorn@erlang.org>
* erts: Refactor bif exports to be allocated at start-timeLukas Larsson2020-09-211-10/+10
| | | | | | | | This is needed as BeamAsm needs the export entries to be executable, which means that we need to allocate them. Co-authored-by: John Högberg <john@erlang.org> Co-authored-by: Dan Gudmundsson <dgud@erlang.org>
* Merge branch 'maint'Rickard Green2020-03-131-1/+1
|\ | | | | | | | | * maint: Update copyright year
| * Update copyright yearRickard Green2020-03-131-1/+1
| |
* | erts: Use hidden exports for BIF trappingJohn Högberg2019-09-171-6/+6
|/ | | | | This hides traps when BIFs are traced, making them appear as a single call + return pair.
* erts: Create heap binaries in split_binary/2John Högberg2019-08-091-42/+38
|
* Fix passing large integers as base to integer_to_X/2John Högberg2019-01-101-3/+3
| | | | I noticed this seconds after merging... :(
* Implement integer_to_list/2 and integer_to_binary/2 as CIFsStanislav Mayorov2019-01-101-0/+33
| | | | | This makes them roughly as fast as integer_to_list/1 and integer_to_binary/1.
* Accept base in all integer-printing functionsStanislav Mayorov2019-01-101-27/+56
|
* Update copyright yearHenrik Nord2018-06-181-1/+1
|
* New process_info() implementation using signalsRickard Green2018-04-121-0/+34
|
* Merge branch 'john/erts/fix-iolist-bitstring-badarg/OTP-14926' into maintJohn Högberg2018-02-191-1/+4
|\
| * badarg on iolist_to_binary(Bitstring)John Högberg2018-02-151-1/+4
| | | | | | | | | | When supplied without an enclosing list, bitstrings were returned as-is instead of badarging.
* | erts: Refactor ProcBin creationSverker Eriksson2018-01-041-37/+26
|/ | | | into utility functions.
* Update copyright yearRaimo Niskanen2017-05-041-1/+1
|
* erts: Init refc=1 in erts_bin_nrml_allocSverker Eriksson2017-04-111-2/+0
| | | | | Only term_to_binary needed some extra attention as it used to initialize refc as 0 instead of 1.
* Merge branch 'fix-source-typos'Björn Gustavsson2017-02-151-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix-source-typos: (25 commits) Fixed typos in system/doc Fixed typos in lib/xmerl Fixed typos in lib/wx Fixed typos in lib/stdlib Fixed typos in lib/snmp Fixed typos in lib/ssl Fixed typos in lib/ssh Fixed typos in PKCS-8.asn1 file Fixed typos in lib/parsetools Fixed typos in lib/orber Fixed typos in lib/mnesia Fixed typos in lib/megaco Fixed typos in lib/kernel Fixed typos in lib/jinterface Fixed typos in lib/inets Fixed typos in lib/hipe Fixed typos in lib/eunit Fixed typos in lib/erl_interface Fixed typos in lib/eldap Fixed typos in lib/edoc ...
| * Fixed typos in ertsAndrew Dryga2017-02-141-2/+2
| |
* | erts: Add deallocation veto for magic destructorsSverker Eriksson2017-02-141-2/+4
|/ | | | | A magic destructor can return 0 and thereby take control and prolong the lifetime of a magic binary.
* Use magic refs for list_to_binary/binary_to_list trapsRickard Green2017-02-061-8/+7
|
* Implement magic referencesRickard Green2017-02-061-7/+2
| | | | | | | | | | | | | | | | | | | | Magic references are *intentionally* indistinguishable from ordinary references for the Erlang software. Magic references do not change the language, and are intended as a pure runtime internal optimization. An ordinary reference is typically used as a key in some table. A magic reference has a direct pointer to a reference counted magic binary. This makes it possible to implement various things without having to do lookups in a table, but instead access the data directly. Besides very fast lookups this can also improve scalability by removing a potentially contended table. A couple of examples of planned future usage of magic references are ETS table identifiers, and BIF timer identifiers. Besides future optimizations using magic references it should also be possible to replace the exposed magic binary cludge with magic references. That is, magic binaries that are exposed as empty binaries to the Erlang software.
* erts_new_mso_binary(): do not truncate lenMikael Pettersson2016-05-051-1/+1
|
* update copyright-yearHenrik Nord2016-03-151-1/+1
|
* Merge branch 'master' into sverk/master/halt-INT_MINSverker Eriksson2016-02-241-7/+74
|\
| * Improve yield strategy for list_to_binary()/binary_to_list()Rickard Green2015-11-121-7/+74
| | | | | | | | | | | | Avoid yield in the BIF when input is small. This either yielding before beginning to work in the BIF, or by allowing some more reductions before yielding.
* | erts: Change erl_exit into erts_exitSverker Eriksson2016-02-241-1/+1
|/ | | | | | | | | | | | | | | | | This is mostly a pure refactoring. Except for the buggy cases when calling erlang:halt() with a positive integer in the range -(INT_MIN+2) to -INT_MIN that got confused with ERTS_ABORT_EXIT, ERTS_DUMP_EXIT and ERTS_INTR_EXIT. Outcome OLD erl_exit(n, ) NEW erts_exit(n, ) ------- ------------------- ------------------------------------------- exit(Status) n = -Status <= 0 n = Status >= 0 crashdump+abort n > 0, ignore n n = ERTS_ERROR_EXIT < 0 The outcome of the old ERTS_ABORT_EXIT, ERTS_INTR_EXIT and ERTS_DUMP_EXIT are the same as before (even though their values have changed).
* Change license text to APLv2Bruce Yinhe2015-06-181-9/+10
|
* Merge branch 'sverk/hipe-inline-reserve-trap-frame'Sverker Eriksson2014-10-241-0/+2
|\ | | | | | | | | | | * sverk/hipe-inline-reserve-trap-frame: erts: Extend usage of ASM macro to avoid including asm macros in C code erts: Make hipe_{un}reserve_beam_trap_frame INLINE
| * erts: Make hipe_{un}reserve_beam_trap_frame INLINESverker Eriksson2014-10-241-0/+2
| |
* | erts: Refactor binary allocation interface to also initialize BinarySverker Eriksson2014-09-041-5/+0
|/ | | | | except the reference counter 'refc', as different callers have different strategies regarding the lifetime of the binary.
* Make binary BIFs converting from lists yield on large inputRickard Green2014-05-221-216/+796
| | | | | | | - erlang:list_to_binary/1 - erlang:iolist_to_binary/1 - erlang:list_to_bitstring/1 - binary:list_to_bin/1
* Make binary BIFs converting to lists yield on large inputRickard Green2014-05-221-5/+144
| | | | | | - erlang:binary_to_list/1 - erlang:binary_to_list/3 - erlang:bitstring_to_list/1
* erts: Use fast path for list_to_binary([Bin]) caseBjörn-Egil Dahlberg2013-04-301-0/+11
| | | | | | A common case is to wrap an argument to list_to_binary in a list to ensure conversion can happen even though the argument may already be a binary. Use fast path for this case.
* Add new binary conversion bifsLukas Larsson2013-02-141-0/+92
| | | | Added: binary_to_integer/1,2, integer_to_binary/1,2
* Update copyright yearsBjörn-Egil Dahlberg2013-01-251-1/+1
|
* Implement true asynchronous signaling between processes and portsRickard Green2012-12-071-3/+3
|
* Get cerl and distribution working in Win64Patrik Nyblom2011-12-021-1/+1
| | | | Can still not setup -a, but cerl works.
* erts: Remove debug variable in list_to_binaryBjörn-Egil Dahlberg2011-11-071-2/+8
|
* Fix overflow in list_to_bitstring/1Björn Gustavsson2011-05-101-23/+67
| | | | Noticed-by: Jon Meredith
* Replace io_list_len() with erts_iolist_size()Björn Gustavsson2011-05-101-5/+8
| | | | | | | | | | | | | | | | | | The io_list_len() function returns an int, where a negative return value indicates a type error. One problem is that an int only consists of 32 bits in a 64-bit emulator. Changing the return type to Sint will solve that problem, but in the 32-bit emulator, a large iolist and a iolist with a type error will both return a negative number. (Noticed by Jon Meredith.) Another problem is that for iolists whose total size exceed the word size, the result would be truncated, leading to a subsequent buffer overflow and emulator crash. Therefore, introduce the new erts_iolist_size() function which returns a status indication and writes the result size through a passed pointer. If the result size does not fit in a word, return an overflow indication.
* Update copyright yearsBjörn-Egil Dahlberg2011-03-111-1/+1
|
* Fix 18 exabyte memory allocation failureBjörn Gustavsson2011-03-091-1/+1
| | | | | | | | | | | | The new_binary() function takes a size argument that is an int. In the 64-bit emulator (sizeof(int) == 4, sizeof(Uint) == 8), any sizes >= 0x8000000 become 0xffffffff80000000 and above and triggers a memory allocation failure. Change the type of the size argument to Uint, and change any callers that cast the argument to an int. Correction-by: Jon Meredith
* Add bifs to translate between erlang filenames and native encodingPatrik Nyblom2010-11-291-5/+5
|
* Increase vheap counter to Uint64Björn-Egil Dahlberg2010-08-121-2/+2
| | | | | | | | | This will reduce the risk of integer wrapping in bin vheap counting. The vheap size series will now use the golden ratio instead of doubling and fibonacci sequences. OTP #8730