Age | Commit message (Collapse) | Author |
|
Now that we have OS macros for essentially every supported OS, let's try
to use them everywhere.
|
|
This commit moves the length calculations out to be directly on the
StringView users. This is an important step towards the goal of removing
StringView(char const*), as it moves the responsibility of calculating
the size of the string to the user of the StringView (which will prevent
naive uses causing OOB access).
|
|
LibMain is dynamically linked in every binary. This results in a
slightly slower load time. In the past people have pegged this at 0.7
ms on some hardware.
This change makes it statically linked and eliminates 0.6 ms of
run-time on my machine. This is tested by running a script which just
executed `/bin/true` in a loop 10,000 times. Before this patch it
reliably executed in ~90,000 ms. After this patch it is ~84,000
ms. This is a speed up of 6,000 ms over 10,000 executions, or 0.6 ms
per execution.
|
|
Some POSIX utilities are specified to return a specific value on error,
which is not 1. `Main::set_return_code_for_errors()` lets you set it to
that value.
|
|
|
|
Rather than finding apps that benefit from time zone awareness one-by-
one, and calling tzset in their serenity_main, let's do it in LibMain.
|
|
Stealing what Andreas did for the `dbgln` output, I think it also looks
nice inside of Terminal :^)
|
|
When on Lagom, `warnln` and `dbgln` both output to `stderr`. This makes
runtime errors duplicated and more verbose than necessary.
|
|
And let's make them red too, to help us notice them. :^)
|
|
Print the full associated string metadata by default (if available.)
|
|
Before this change, we would need to write arguments.arguments to access
the Span<>, which doesn't feel too pretty.
|
|
This creates an error that contains the name of the syscall that failed.
This allows error handlers to print out the name of the call if they
want to. :^)
|
|
By linking with LibMain, your program no longer needs to provide main().
Instead, execution begins in this function:
ErrorOr<int> serenity_main(Main::Arguments);
This allows programs that link with LibMain to use TRY() already in
their entry function, without having to do manual ErrorOr unwrapping.
This is very experimental, but it seems like a nice idea so let's try it
out. :^)
|