Commit graph

12927 commits

Author SHA1 Message Date
asynts 910924f559 AK: Moved TypedTransfer into it's own header. 2020-09-09 20:15:50 +02:00
Tom 678bbd29ca Kernel: Fix heap expansion loop
By being a bit too greedy and only allocating how much we need for
the failing allocation, we can end up in an infinite loop trying
to expand the heap further. That's because there are other allocations
(e.g. logging, vmobjects, regions, ...) that happen before we finally
retry the failed allocation request.

Also fix allocating in page size increments, which lead to an assertion
when the heap had to grow more than the 1 MiB backup.
2020-09-09 20:14:30 +02:00
Tom efe2b75017 Kernel: Optimize single physical page allocation and randomize returns
Rather than trying to find a contiguous set of bits of size 1, just
find one single available bit using a hint.

Also, try to randomize returned physical pages a bit by placing them
into a 256 entry queue rather than making them available immediately.
Then, once the queue is filled, pick a random one, make it available
again and use that slot for the latest page to be returned.
2020-09-09 13:02:14 +02:00
Tom 92e400c7f9 AK: Add Bitmap::find_one_anywhere and optimize Bitmap::find_first
Leverage constexpr and __builtin_ffs for Bitmap::find_first. Also add
a variant Bitmap::find_one_anywhere that can start scanning at a
provided hint.

Also, merge Bitmap::fill_range into the already existing Bitmap::set_range
2020-09-09 13:02:14 +02:00
Nico Weber 42153221a5 sleep: On SIGINT, call default SIGINT handler after printing remaining time
With this, hitting ctrl-c twice in `for i in $(seq 10) { sleep 1 }`
terminates the loop as expected (...well, I'd expect it to quit after
just one ctrl-c, but serenity's shell makes a single ctrl-c only
quit the current loop iteration).

Part of #3419.
2020-09-09 12:44:35 +02:00
Tom 92bfe40954 Kernel: Keep signal state in sync
In c3d231616c we added the atomic variable
m_have_any_unmasked_pending_signals tracking the state of pending signals.
Add helper functions that automatically update this variable as needed.
2020-09-09 12:43:56 +02:00
Jakob-Niklas See dcc2c8a125
LibWeb: Add support for viewport-relative length units (#3433)
We can now use vh, vw, vmax and vmin as length units in CSS.
2020-09-08 20:39:09 +02:00
Andreas Kling d467a0ffef LibJS: ArrayIterator needs to mark the array it's iterating 2020-09-08 16:20:34 +02:00
Andreas Kling 3143fea1eb LibJS: GlobalObject needs to mark the iterator prototypes
Otherwise they all disappear in the first garbage collection.
2020-09-08 15:37:39 +02:00
Andreas Kling b32c0c8181 LibJS: Convert two suspicious Vector<Value> to MarkedValueList 2020-09-08 14:16:59 +02:00
Andreas Kling d85eed585c LibJS: get_iterator_values() should pass Value to callback (not Value&)
Value& implies that the callback is expected/able to modify the value,
which is not the case.
2020-09-08 14:15:13 +02:00
Andreas Kling b4bfc3ed54 Spreadsheet: Add "final" to JS objects and tweak declarations 2020-09-08 14:11:43 +02:00
asynts a7cbc7fcb2 AK: Remove empty destructor from JsonParser. 2020-09-08 14:01:21 +02:00
asynts 70dd97c46e AK: Remove FixedArray class. 2020-09-08 14:01:21 +02:00
asynts ec1080b18a Refactor: Replace usages of FixedArray with Vector. 2020-09-08 14:01:21 +02:00
asynts 9c83d6ff46 Refactor: Replace usages of FixedArray with Array. 2020-09-08 14:01:21 +02:00
asynts 76e37e8c96 AK: Add Array<T, Size> template. 2020-09-08 14:01:21 +02:00
asynts 1b3ecb01a5 AK: Add generic SimpleIterator class to replace VectorIterator. 2020-09-08 14:01:21 +02:00
Simon Danner 9648bf4ada LibWeb: SVG: implement SmoothQuadraticBezierCurve
For this we need to track the control point of the previous command and
calculate a new control point based on it.
2020-09-08 13:57:18 +02:00
Simon Danner 772fcba814 LibWeb: SVG: draw commands can also be repeated after a comma
Consume comma or whitespace to make it possible to also parse commands
that use comma separation.
2020-09-08 13:57:18 +02:00
Simon Danner 6e61532e06 LibWeb: SVG: T commands only take two coordinates
The shortcut for Bezier curves only takes two coordinates.
2020-09-08 13:57:18 +02:00
Simon Danner 05be6481b7 LibWeb: make it possible to directly load .svg files
Make LibWeb load svg files by guessing the svg mime type from the file
extension and parsing it with the HTML parser.
2020-09-08 13:57:18 +02:00
AnotherTest 699e1fdc07 LibJS: Eliminate some (unnecessary) Vector copies 2020-09-08 13:43:03 +02:00
AnotherTest 8d9c5a8e70 LibJS: Make MarkedValueList inherit from Vector<Value>
This makes the nicer vector API available to MVL without extra wrapper
functions.
2020-09-08 13:43:03 +02:00
AnotherTest 9a00699983 LibJS: Format IndexedProperties.cpp 2020-09-08 13:43:03 +02:00
Tom 0c2d36d1cd WindowServer: Draw minimize animation inverted
Inverting the pixels makes the animation visible over most colors.
2020-09-08 10:45:35 +02:00
Tom 607c78336b LibGfx: Add ability to draw inverted rectangles 2020-09-08 10:45:35 +02:00
Andreas Kling c460f4a3cb IRCClient: Add the "/me" command to send CTCP ACTION emotes :^)
You can now express your feelings and actions with our IRC client by
using the /me command.
2020-09-07 20:49:35 +02:00
Tom 3a4a9d4c6b WindowServer: Fix invalidating window frame
When invalidating the frame we need to properly flag that so that
we trigger rendering the frame, even if "all" was flagged as being
invalidated. Otherwise it will only get rendered if anything else
happens to trigger it (such as focus change).

Fixes #3427
2020-09-07 19:39:48 +02:00
Jakob-Niklas See 86d230ab5f Documentation: Fixed minor typo in UsingQtCreator 2020-09-07 16:53:29 +02:00
Tom c3d231616c Kernel: Fix crash when delivering signal to barely created thread
We need to wait until a thread is fully set up and ready for running
before attempting to deliver a signal. Otherwise we may not have a
user stack yet.

Also, remove the Skip0SchedulerPasses and Skip1SchedulerPass thread
states that we don't really need anymore with software context switching.

Fixes the kernel crash reported in #3419
2020-09-07 16:49:19 +02:00
Noah Rosamilia f1a65d1d70 Ports: Install lua to /usr/local 2020-09-07 13:34:44 +02:00
Noah Rosamilia f35b19e72d Ports: Clean up lua port and enable dynamic library loading 2020-09-07 13:34:27 +02:00
AnotherTest da1b080935 LibLine: Make ^R search match the input anywhere in a given line
This is closer to what other line editors (and shells) do, and makes ^R
actually useful.
2020-09-07 11:42:56 +02:00
AnotherTest da56e208ef LibLine: Disable editing events while searching
This also makes the editor clean as many lines as the searching took,
for instance, in the case of <C-r><C-c>ls<tab>, two lines should be
cleaned, not just one.

Fixes #3413.
2020-09-07 11:42:56 +02:00
Nico Weber e8131f503d Kernel: Let TimeManagement keep epoch time as timespec
Previously, it was kept as just a time_t and the sub-second
offset was inferred from the monotonic clock. This means that
sub-second time adjustments were ignored.

Now that `ntpquery -s` can pass in a time with sub-second
precision, it makes sense to keep time at that granularity
in the kernel.

After this, `ntpquery -s` immediately followed by `ntpquery` shows
an offset of 0.02s (that is, on the order of network roundtrip time)
instead of up to 0.75s previously.
2020-09-07 11:22:48 +02:00
Nico Weber 4ac5cc2461 ntpquery: Compute and print delay and offset 2020-09-07 11:22:48 +02:00
AnotherTest 39d14c22d1 LibLine: Treat ^D as EOF only when the buffer is empty
As opposed to when the cursor is at the start of the buffer.
Fixes #3421.
2020-09-07 11:21:28 +02:00
Andreas Kling 18ff9c3fc2 Meta: Fix shellcheck whines in check-symbols.sh 2020-09-07 00:00:12 +02:00
Andreas Kling 638790c9a4 Travis: Fix wrong path to Meta/check-symbols.sh 2020-09-06 23:49:19 +02:00
AnotherTest 02f251bb4a LibGUI: Fix OOB read in Clipboard::set_data() 2020-09-06 22:22:17 +02:00
Muhammad Zahalqa 125ea6a214 AK: Vector use Traits<T>::equals in find
Use Traits<T>::equals for equality checking in search
functions instead of  operator==
2020-09-06 21:56:32 +02:00
Muhammad Zahalqa ad3e6ef344 AK: SinglyLinkedList use Traits<T>::equals in find
Use Traits<T>::equals for equality checking in search
functions instead of  operator==
2020-09-06 21:56:32 +02:00
Nico Weber f1a6884a51 ntpquery: Add a -s flag to make it adjust the time 2020-09-06 21:50:55 +02:00
Nico Weber 0fff4e11a6 LibC: Add settimeofday 2020-09-06 21:50:55 +02:00
Nico Weber 0736ae4116 ntpquery: Use time.google.com as default NTP server for now
Using a pool.ntp.org server seems nicer and more open-source-y,
but until our pool use is approved, let's put in a default value
that works.

(time.google.com serves smeared time instead of doing leap seconds.
pool.ntp.org doesn't serve smeared time. I intend to implement
client-side leap second smearing since nobody likes jumpy timestamps.
For now, we get this for free.)
2020-09-06 21:50:55 +02:00
Nico Weber 8016b2c546 ntpquery: Record destination timestamp as well 2020-09-06 21:50:55 +02:00
Itamar 1c20e684f3 Travis: Run script that checks for forbidden symbols in LibC
check-symbols.sh fails the build if undefined __cx_guard_* symbols are
found in  LibC.

This will help us catch port breakage sooner.
2020-09-06 21:36:36 +02:00
Itamar 542f665b27 LibC: Avoid generating calls to__cxa_guard_* functions in netdb.cpp
g++ seems to generate calls to __cxa_guard_* functions when we use
non-trivial initialization of local statics.
Requiring these symbols breaks some ports since these symbols are
defined in libcstdc++ which we do not link against when building ports.

This commit turns some local statics into global statics in netdb.cpp so
libc wouldn't need these symbols.
2020-09-06 21:36:36 +02:00
Itamar c5b0e0b96b LibC: Don't include things required for getopt_long in unistd.h
Previously, we were including the whole of <getopt.h> in <unistd.h>.
However according to the posix <unistd.h> doesn't have to contain
everything we had in <getopt.h>.

This fixes some symbol collisions that broke the git port.
2020-09-06 21:36:36 +02:00