Commit graph

23314 commits

Author SHA1 Message Date
davidot
ae8c4618b7 LibJS: Use as_object instead of as_array in flatten_into_array
Since is_array does not guarantee that it is<Array> we must use
as_object here.
2021-07-07 21:24:26 +01:00
davidot
4846c4a94e LibJS: Fix types and small spec discrepancy in ArrayPrototype::fill 2021-07-07 21:24:26 +01:00
davidot
6c47b77998 LibJS: Fix types and small spec discrepancy in ArrayPrototype::splice 2021-07-07 21:24:26 +01:00
davidot
7a41c758c0 LibJS: Fix types and small spec discrepancy in ArrayPrototype::includes 2021-07-07 21:24:26 +01:00
davidot
cb44fc528b LibJS: Add a way of constructing PropertyName with values above 2**32-1
This is often needed in ArrayPrototype when getting items with indices
above 2**32-1 is possible since length is at most 2**53-1.
This also fixes a number of these cases in ArrayPrototype where the type
was not big enough to hold the potential values.
2021-07-07 21:24:26 +01:00
davidot
a70033481d LibJS: Fix that length was sometimes cast to [ui]32
Since array-like objects can have much larger lengths even a u32 is not
sufficient.
2021-07-07 21:24:26 +01:00
davidot
7310713d11 LibJS: Remove fast array paths in ArrayPrototype::{pop, push}
Unfortunately this fast path leads to problems if Array.prototype is
changed. We probably need to find out some way to optimize these methods
by detecting changes to the prototype or other mechanisms.
2021-07-07 21:24:26 +01:00
Liav A
2900c8cf09 Documentation: Add simple troubleshooting guide
In this guide, we explain two boot errors that can occur and what can be
done to solve them.
2021-07-07 22:18:36 +02:00
Liav A
cc98871383 Kernel: Print if image has become too large again
Instead of just disabling interrupts and halting when entering the C++
section, just halt with a printed message indicating the error.
2021-07-07 22:18:36 +02:00
Tom
a95b726fd8 Kernel: Fix race causing modifying a Process to fail with a panic
The ProtectedDataMutationScope cannot blindly assume that there is only
exactly one thread at a time that may want to unprotect the Process.
Most of the time the big lock guaranteed this, but there are some cases
such as finalization (among others) where this is not necessarily
guaranteed.

This fixes random panics due to access violations when the
ProtectedDataMutationScope protects the Process instance while another
is still modifying it.

Fixes #8512
2021-07-07 21:57:01 +02:00
Tom
942bb976e2 Kernel: Add AtomicEdgeAction class
This class acts like a combined ref-count as well as a spin-lock
(only when adding the first or removing the last reference), allowing
to run a specific action atomically when adding the first or dropping
the last reference.
2021-07-07 21:57:01 +02:00
Linus Groh
116f1c5c56 Ports: Update Python to 3.9.6
Released on 2021-06-28.
https://www.python.org/downloads/release/python-396/
2021-07-07 20:24:48 +01:00
Andreas Kling
4ad389d0d6 Ports: Add a missing pipe character to AvailablePorts.md 2021-07-07 21:21:37 +02:00
Andreas Kling
cf77d6aa98 Ports: Add r0 to AvailablePorts.md 2021-07-07 21:08:54 +02:00
Andreas Kling
092e5b75ba WindowServer: Add WindowFrame::invalidate_menubar() and use it
Clean up a FIXME about overly aggressive invalidation.
2021-07-07 21:06:15 +02:00
Linus Groh
b180e154aa LibJS: Add thousands separators to nanoseconds multiplier value
Increases readability. Thanks to @nico for noticing this!
2021-07-07 20:01:08 +01:00
LuK1337
6319796f58 LibGfx: BitmapFont: Handle '\r' and '\n' when calculating text width
Previously calculating multiline text width would return invalid value,
this change makes it so that we are returning the longest line width.

We are now also reusing same width() implementation for both UTF-8 and
UTF-32 strings.
2021-07-07 20:29:29 +02:00
Ralf Donau
6386c2d880 Userland: Add pledge to less 2021-07-07 20:27:40 +02:00
pancake
4ac8d9c2ac Ports: Add minimalistic r0 hexadecimal editor 2021-07-07 20:27:15 +02:00
Linus Groh
96167e39e7 js: Implement pretty-printing of Temporal.Instant objects 2021-07-07 19:00:42 +01:00
Linus Groh
3a39ff8f40 LibJS: Implement Temporal.now.instant() 2021-07-07 19:00:42 +01:00
Linus Groh
47fb4286c7 LibJS: Start implementing Temporal.Instant
Just like the initial Temporal.TimeZone commit, this patch adds the
Instant object itself, its constructor and prototype (currently empty),
and two required abstract operations.
2021-07-07 19:00:42 +01:00
Linus Groh
d9cff591b6 LibJS: Add error message for invalid time zone in Temporal.TimeZone() 2021-07-07 19:00:42 +01:00
Linus Groh
89641d90db LibCrypto: Add operator>() to UnsignedBigInteger and SignedBigInteger
Piggybacking on operator!=() and operator<().
2021-07-07 19:00:42 +01:00
Andreas Kling
fda22c6889 FileManager: Fix Desktop rubber-banding getting clipped at the edge
The issue was that the desktop IconView has Gfx::FrameShape::NoFrame as
its frame shape, but with a non-zero frame_thickness().

This caused us to not render a frame, but to include one in the
selection boundary calculations.

Fix this by setting the desktop icon view's frame thickness to 0.

Fixes #8525.
2021-07-07 18:10:19 +02:00
Andreas Kling
86d0145260 LibGfx+LibGUI+WindowServer: Use move() on Core::AnonymousBuffer more 2021-07-07 18:02:43 +02:00
Andreas Kling
4cb0bbef9d LibCore: Make Core::AnonymousBuffer moveable 2021-07-07 18:02:43 +02:00
Andreas Kling
e0986c2766 LibGUI: Fix some clang-tidy warnings in Window.cpp 2021-07-07 18:02:43 +02:00
Andreas Kling
d66dab2d41 LibGUI: Remove spammy debug message from ColumnsView 2021-07-07 18:02:43 +02:00
Andreas Kling
fd155193e7 LibThreading: Use a condvar to signal the BackgroundAction thread
Now that pthread_cond_t works correctly thanks to Sergey, we can use
them to wake up the BackgroundAction worker thread instead of making
a Unix pipe. :^)
2021-07-07 18:02:43 +02:00
Aziz Berkay Yesilyurt
5fbb1d9e01 Userland: Convert delay option to unsigned for shot
A negative delay option for shot was used to underflow when passed to
sleep. Now, it returns an error for a negative delay value.
2021-07-07 20:05:43 +04:30
Aziz Berkay Yesilyurt
7db3e962f3 LibCore: Add unsigned option to ArgsParser
Unsigned options are used to return underflowed values for negative
inputs. With this change, we can verify that unsigned options only
accept unsigned inputs as arguments.
2021-07-07 20:05:43 +04:30
Peter Elliott
9b40208e3b Documentation: Add less(1) man page, and link to it in others 2021-07-07 20:01:15 +04:30
Peter Elliott
a11658737a Userland: Less: emulate cat when stdout is not a tty
This is the most logical behavior when less is used in a pipe.
2021-07-07 20:01:15 +04:30
Peter Elliott
1ec061d666 Userland: Add pager option to man and use less by default 2021-07-07 20:01:15 +04:30
Peter Elliott
c6fa2f196a Userland: Add more(1) emulation to less(1)
This patch also removes the existing implementation of more, as it is
now redundant.
2021-07-07 20:01:15 +04:30
Peter Elliott
30aa9b837c Userland: Add minimal prompt support to less
GNU less has a pretty cool prompt format language. This patch adds
support for the language and specifiers for filename, linenumber, and
ending.
2021-07-07 20:01:15 +04:30
Peter Elliott
7ee1983db6 Userland: Add less, a better terminal pager
less is a re-implementation of gnu less, a terminal pager with backwards
scrolling and alternate screen support.
2021-07-07 20:01:15 +04:30
Sergey Bugaev
e8d5b16733 test-pthread: Add a mutex test 2021-07-07 17:08:40 +02:00
Sergey Bugaev
65b0642dd0 LibC+LibPthread: Use FUTEX_PRIVATE_FLAG in more places
Performance go brrrrr
2021-07-07 17:08:40 +02:00
networkException
39a3f42534 GameOfLife: Properly switch between play and pause icon
The play and pause icon were previously set on the toggle Action
and not on the Button of the Action that is part of the Toolbar
2021-07-07 15:29:37 +01:00
Yuval Tasher
b08383c48d Assistant: Compare two chars instead of StringViews of length 1 2021-07-07 15:58:57 +02:00
Andres Crucitti
f6f14777ac WindowServer: Allow windows to be pinnable (always on top)
This patch adds the concept of a window being "Pinnable" (always drawn
on top of other windows). This can be toggled through a new checkable
action in the top left corner's window menu.
2021-07-07 15:38:59 +02:00
Max Wipfli
d5722eab36 Kernel: Custody::absolute_path() => try_create_absolute_path()
This converts most users of Custody::absolute_path() to use the new
try_create_absolute_path() API, and return ENOMEM if the KString
allocation fails.
2021-07-07 15:32:17 +02:00
Max Wipfli
0f8a6e574c Kernel: Add formatter function for OwnPtr<KString>
This adds a formatter function for OwnPtr<KString>. This is added mainly
because lots of dbgln() statements generate Strings (such as absolute
paths) which are only used for debugging. Instead of catching possible
OOM situations at all the dbgln() callsites, this makes it possible to
let the formatter code handle those situations by outputting "[out of
memory]" if the OwnPtr is null.
2021-07-07 15:32:17 +02:00
Max Wipfli
95f769ea51 Kernel: Add Custody::try_create_absolute_path()
This adds a way to get a Custody's absolute path as KString, which
enables it to fail gracefully on OOM.
2021-07-07 15:32:17 +02:00
Max Wipfli
1f792faf34 Kernel: Add KLexicalPath::try_join and use it
This adds KLexicalPath::try_join(). As this cannot be done without
allocation, it uses KString and can fail. This patch also uses it at one
place. All the other cases of String::formatted("{}/{}", ...) currently
rely on the return value being a String, which means they cannot easily
be converted to use the new API.
2021-07-07 15:32:17 +02:00
Max Wipfli
ee342f5ec3 Kernel: Replace usage of LexicalPath with KLexicalPath
This replaces all uses of LexicalPath in the Kernel with the functions
from KLexicalPath. This also allows the Kernel to stop including
AK::LexicalPath.
2021-07-07 15:32:17 +02:00
Max Wipfli
87a62f4def Kernel: Add KLexicalPath
This adds KLexicalPath, which are a few static functions which aim to
mostly emulate AK::LexicalPath. They are however constrained to work
with absolute paths only, containing no '.' or '..' path segments and no
consecutive slashes. This way, it is possible to avoid use StringView
for the return values and thus avoid allocating new String objects.

As explained above, the functions are currently very strict about the
allowed input paths. This seems to not be a problem currently. Since the
functions VERIFY this, potential bugs caused by this will become
immediately obvious.
2021-07-07 15:32:17 +02:00
Gunnar Beutner
75ba74a216 Tests: Build all tests on x86_64
This builds some previously-disabled tests for x86_64.
2021-07-07 15:29:18 +02:00