aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_lists.c
AgeCommit message (Collapse)Author
2019-07-01Merge branch 'john/erts/lists_subtract_fixes/OTP-15938/OTP-15939' into maintJohn Högberg
* john/erts/lists_subtract_fixes/OTP-15938/OTP-15939: erts: Fix integer overflow in loader erts: Fix integer overflow in list subtraction
2019-07-01erts: Fix integer overflow in list subtractionJohn Högberg
CMP_TERM returned an `Sint`, which overflowed the `int` used in erl_rbtree for storing the comparison, causing list subtraction to behave strangely.
2018-12-10erl_bif_list: Remove faulty assertionBjörn Gustavsson
The variable can be an empty list.
2018-12-06Merge branch 'maint'Lukas Larsson
Conflicts: erts/emulator/beam/erl_process.c
2018-12-06Merge branch 'lukas/OTP-21.1.1/scheduler_pollset/OTP-15475' into maintLukas Larsson
* lukas/OTP-21.1.1/scheduler_pollset/OTP-15475: erts: Move fds with active true behaviour to own pollset erts: Fix lists_member_2 reduction count erts: Allow code_model_small to be set in xcomp setting erts: Implement delay_send using timer instead of poll erts: Optimize driver_set_timer(0) to fire at once erts: Optimize the inet driver multi timers for one timer erts: Move all inet tcp CONNECTED timers to multi timer erts: Add erts_io_notify_port_task_executed to check_io msacc state erts: Add pre-alloc to ALLOC msacc state erts: Make thr prgr wakeup current or sched 1 erts: Pass thread progress data where possible
2018-12-03erts: Fix lists_member_2 reduction countLukas Larsson
OTP-15474
2018-11-09Don't use too many reductions in lists:reverse/2John Högberg
2018-11-09Make '++'/2 trappingJohn Högberg
2018-10-29Optimize operator '--' and yield on large inputsJohn Högberg
The removal set now uses a red-black tree instead of an array on large inputs, decreasing runtime complexity from `n*n` to `n*log(n)`. It will also exit early when there are no more items left in the removal set, drastically improving performance and memory use when the items to be removed are present near the head of the list. This got a lot more complicated than before as the overhead of always using a red-black tree was unacceptable when either of the inputs were small, but this compromise has okay-to-decent performance regardless of input size. Co-authored-by: Dmytro Lytovchenko <[email protected]>
2018-10-25Fix trapping in lists:reverse/2John Högberg
The first stage wasn't bounded by reductions, and it bumped far more reductions than it should have due to a logic bug.
2018-09-21Update copyright yearHenrik Nord
2018-09-13Improve trapping in lists:reverse/2John Högberg
If the process had more free space than reductions it could run a lot longer than it was supposed to. It didn't honor the number of reductions going in either, nor did it bump reductions when returning its result or erroring out. This commit also removes this function from a work function in scheduler_SUITE as it's extremely sensitive to the number of reductions spent in the test, causing equal_and_high_with_part_time_max to fail on some machines.
2016-04-13Merge branch 'egil/erts/opt-list_append/OTP-13487'Björn-Egil Dahlberg
* egil/erts/opt-list_append/OTP-13487: erts: Optimize '++' operator
2016-04-11erts: Optimize '++' operatorBjörn-Egil Dahlberg
This also optimizes the BIF lists:append/2 Use one pass to check for properness and copying LHS list. If LHS turns out not being a proper list, bail and reset htop. If we run out of heap, allocate a heap-fragment and calculate the remaining length as normal, thus checking for properness, and then continue copying. Measurements shows this being ~50% faster.
2016-03-15update copyright-yearHenrik Nord
2016-02-08erts: Use Sint instead of int for list lengthsRichard Carlsson
This avoids potential integer arithmetic overflow for very large lists.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-03-30erts: Optimize == and /= for unequal big mapsSverker Eriksson
Bail out as soon as we find a diff between maps if we are not interested in term order.
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.
2011-10-26Use the proper macros in all BIFsBjörn Gustavsson
As a preparation for changing the calling convention for BIFs, make sure that all BIFs use the macros. Also, eliminate all calls from one BIF to another, since that also breaks the calling convention abstraction.
2011-02-18HALFWORD ETS Fix copyright year in some source filesSverker Eriksson
2011-02-03HALFWORD ETS relative termsSverker Eriksson
In halfword emulator, make ETS use a variant of the internal term format that uses relative offsets instead of absolute pointers. This will allow storage in high memory (>4G). Preprocessor macros (like list_val_rel(TERM,BASE)) are used to make normal (fullword) emulator almost completely unchanged while still reusing most of the code.
2010-03-22Merge branch 'pan/otp_8332_halfword' into devErlang/OTP
* pan/otp_8332_halfword: Teach testcase in driver_suite the new prototype for driver_async wx: Correct usage of driver callbacks from wx thread Adopt the new (R13B04) Nif functionality to the halfword codebase Support monitoring and demonitoring from driver threads Fix further test-suite problems Correct the VM to work for more test suites Teach {wordsize,internal|external} to system_info/1 Make tracing and distribution work Turn on instruction packing in the loader and virtual machine Add the BeamInstr data type for loaded BEAM code Fix the BEAM dissambler for the half-word emulator Store pointers to heap data in 32-bit words Add a custom mmap wrapper to force heaps into the lower address range Fit all heap data into the 32-bit address range
2010-03-10Fit all heap data into the 32-bit address rangePatrik Nyblom
This is the first step in the implementation of the half-word emulator, a 64-bit emulator where all pointers to heap data will be stored in 32-bit words. Code specific for this emulator variant is conditionally compiled when the HALFWORD_HEAP define has a non-zero value. First force all pointers to heap data to fall into a single 32-bit range, but still store them in 64-bit words. Temporary term data stored on C stack is moved into scheduler specific storage (allocated as heaps) and macros are added to make this happen only in emulators where this is needed. For a vanilla VM the temporary terms are still stored on the C stack.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP