Age | Commit message (Collapse) | Author |
|
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).
No functional changes.
|
|
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
|
|
Similar to `W^X` and `wxallowed`, this allows for anonymous executable
mappings.
|
|
|
|
|
|
|
|
ValueFormat::text_formatter is called with a u64 retrieved from
GraphWidget::m_values. However, the function pointer definition used
size_t and all the users of text_formatter used int. If bytes was over
~2 billion, we would interpret bytes to be negative. We then pass this
into `human_readable_size` which converts it to a u64, making it out to
be about 15.9 EiB.
This is fixed by making everything in the path take a u64.
|
|
The main event loop functionality was used in just two places where the
alternative is a bit simpler. Remove it in favor of referencing the
event loop directly, or just invoking `EventLoop::current()`.
Note that we don't need locking in the constructor since we're now only
modifying a thread-local `Vector`. We also don't need locking in the
old call sites to `::with_main_locked()` since we already lock the
event loop in the subsequent `::post_event()` invocation.
|
|
I think this was left in by mistake. No application should be hard-coded
as inspectable.
|
|
|
|
Having bogus values here when we just initialize the thread state with a
process can lead to all sorts of bad things down the line, like infinite
draws.
|
|
In the process model we check the thread with tid=pid to figure out the
main thread of a process. This is used to construct the process view
tree with non-main threads listed as children of the process row.
However, there are sometimes circumstances where there is no main
thread, even though the process should have been removed from the
internal list by then. As a safe fallback, let's default to an invalid
model index if we can't figure out what the main thread of a process is.
|
|
This is a hack until persistent model indices work.
|
|
This shows all non-main threads as children of the process they belong
to. We also show the TID as that is important to distinguish the
different threads in one process.
Fixes #65
:skeleyak:
|
|
This will cause trouble later when the row is not enough to identify a
selection.
|
|
This will look much nicer once we enable that column.
|
|
This is what the Intel manual, as well as Linux's cpuinfo calls it.
|
|
Extra stuff done in this commit to facilitate the above (if you want to
really push my commit count, ask for more atomicisation):
- Register a bunch of widgets that are used in the process window.
- Allow setting the pid after the fact for the process state widget.
|
|
This was causing a bunch of lag (at least half a second, very
noticeable) when first opening the hardware tab, as we would only load
the PCI database when initializing the widget lazily. By starting the
PCI database open on another thread, we avoid this entirely, as nobody
can click the hardware tab this fast :^)
|
|
|
|
This is just a LazyWidget with fancy initialization code that works
perfectly in isolation.
|
|
:^)
|
|
|
|
The property graph_widget on MemoryStatsWidget is a-pseudo property that
specifies the name of the graph widget which should be attached to the
MemoryStatsWidget. When the property is set, the widget looks up the
graph with that name in its parent, therefore automatically linking to
the correct widget given that it's a sibling or descendant of a sibling.
|
|
This also requires that the associated graph widget may be null.
|
|
|
|
We don't want to clobber the global namespace with registered widgets.
|
|
TabWidgets couldn't be used in GML properly, as the GML creation
routines didn't actually call the necessary functions in the TabWidget
to get a new tab added. This commit fixes that by making the name of the
tab a normal property, the previously introduced "title", which can be
trivially set from GML. Therefore, try_add_widget() loses an argument
(while try_add_tab doesn't, because it newly constructs the widget).
This allows us to get rid of the silly "fixing my widget tree after the
fact" code in Help and will make it super easy to use TabWidget in
future GML. :^)
|
|
|
|
|
|
When using the stack tab as root LibSymbolication uses this file to
provide Kernel symbols.
|
|
|
|
The model has a fixed number of rows based on the column enum
and shouldn't need to be invalidated every update.
|
|
Add function to update a JsonArrayModel without invalidating it. Now,
for example in the SystemMonitor in the Network tab, a selected line
will not be deselected whenever the data is updated.
|
|
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#cother-other-default-operation-rules
"The compiler is more likely to get the default semantics right and
you cannot implement these functions better than the compiler."
|
|
pledge_domains() that takes only one String argument was specifically
added as a shortcut for pledging a single domain. So, it makes sense to
use singular here.
|
|
The event loop system was previously very singletony to the point that
there's only a single event loop stack per process and only one event
loop (the topmost) can run at a time. This commit simply makes the event
loop stack and related structures thread-local so that each thread has
an isolated event loop system.
Some things are kept at a global level and synchronized with the new
MutexProtected: The main event loop needs to still be obtainable from
anywhere, as it closes down the application when it exits. The ID
allocator is global as IDs should not be shared even between threads.
And for the inspector server connection, the same as for the main loop
holds.
Note that currently, the wake pipe is only created by the main thread,
so notifications don't work on other threads.
This removes the temporary mutex fix for notifiers, introduced in
0631d3fed5623c1f2b0d6085ab24e4dd69c6ce99 .
|
|
In case when the PCI class, device or vendor is unknown, show
that it is unknown instead of just putting the ID
|
|
When we have less than 4 CPUs we don't need to display a whole row of
CPU graphs.
|
|
The point of a reference type is to behave just like the referred-to
type. So, a Foo& should behave just like a Foo.
In these cases, we had a const Vector. If it was a const Vector of Foo,
iterating over the Vector would only permit taking const references to
the individual Foos.
However, we had a const Vector of Foo&. The behavior should not
change. We should still only be permitted to take const references to
the individual Foos. Otherwise, we would be allowed to mutate the
individual Foos, which would mutate the elements of the const Vector.
This wouldn't modify the stored pointers, but it would modify the
objects that the references refer to. Since references should be
transparent, this should not be legal.
So it should be impossible to get mutable references into a const
Vector. Since we need mutable references in these cases to call the
mutating member functions, we need to mark the Vector as mutable as
well.
|
|
This looks much nicer than the current cramped single-row solution.
|
|
There's no need to specify the type of the member in it's name,
especially not in shorthand format.
|
|
build_process_window now uses try_set_main_widget and might return an
error. process_properties_action handles a possible error by simply
not updating the process window if an error occured while building it.
|
|
These two helpers were the only unused functions clang could detect in
the entire codebase. Now that's commitment to no dead code :^)
|
|
These are almost always bugs, so enable globally.
Remove unused counter variables in SystemMonitor and disk_benchmark.
|
|
This was a premature optimization from the early days of SerenityOS.
The eternal heap was a simple bump pointer allocator over a static
byte array. My original idea was to avoid heap fragmentation and improve
data locality, but both ideas were rooted in cargo culting, not data.
We would reserve 4 MiB at boot and only ended up using ~256 KiB, wasting
the rest.
This patch replaces all kmalloc_eternal() usage by regular kmalloc().
|
|
|
|
Unfortunately, most of the users are inside constructors, (and two
others are inside callback lambdas) so the error can't propagate, but
that can be improved later.
|
|
Since the call to lock the veil was missing, the protections provided
by unveil() were not actually enabled.
|
|
User code does not need to keep this alive, so casting to void is safe.
But maybe a bit weird.
|