It does have a performance impact (as it serializes all VMCache
creations), and it is not that useful, so move it to KDEBUG_LEVEL_2
so that the beta releases (on KDEBUG_LEVEL_1) are not affected
by it.
(The nightlies are on KDEBUG_LEVEL_2, so this will not affect
them.)
Change-Id: Iab35d58f9d210651e3fd9027b75ea27a7a6928e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2612
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This reverts hrev54120 and instead adds the commonly supported
MAP_NORESERVE flag to request overcommit.
Using PROT_NONE for overcommit is problematic as the protection of
individual pages can still be changed via mprotect to make them
accessible, but that won't change the commitment. An application
using such a pattern may then unexpectedly run into out of memory
conditions on random writes into the address space.
With MAP_NORESERVE the overcommit can explicitly be requested by
applications that want to reserve address space without producing
memory pressure.
Change-Id: Id213d2245c5e23103e8e0857f7902e0cd8a2c65d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2611
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
A minimal layout cleanup for beta2. Further changes were proposed in a
separate ticket, #9781, maybe for later.
Fixes#9780.
Change-Id: I1f66d808bd2cea683aa9f3a905cdf5717f1824ef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2607
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Don't pretend file copies will end in 1901, that's obviously wrong.
Helps with #11176, but we should really not use time_t here, or make it
64bit.
Fun fact: we're now closer to the end of the UNIX epoch than to the creation
of Haiku!
Change-Id: I64acc5ab29fb778fe3034c65b5a8418951d30505
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2608
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The use of individual _SwapBlockGetAddress() and _SwapBlockFree() calls
would lock and unlock the swap hash for each page.
Using _FreeSwapPageRange() also allows to skip entire blocks when they
are not present or get empty early.
Change-Id: Ia76735e514cf8967d282e099cf5409fe1b104297
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2590
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Rename MovePageRange to Adopt and group it with Resize/Rebase as it
covers the third, middle cut case.
Implement VMAnonymousCache::Adopt() to actually adopt swap pages. This
has to recreate swap blocks instead of taking them over from the source
cache as the cut offset or base offset between the caches may not be
swap block aligned. This means that adoption may fail due to memory
shortage in allocating the swap blocks.
For the middle cut case it is therefore now possible to have the adopt
fail in which case the previous cache restore logic is applied. Since
the readoption of the pages from the second cache can fail for the same
reason, there is a slight chance that we can't restore and lose pages.
For now, just panic in such a case and add a TODO to free memory and
retry.
Change-Id: I9a661f00c8f03bbbea2fe6dee90371c68d7951e6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2588
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Otherwise pages from it would later be tried to be written back with
nowhere to go in case of temporary caches.
Change-Id: I81e7335408c419a9b2c7bbb31290d551f5508d56
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2586
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
When only some initial slots of a block were filled, the block would
become unused early and get freed. The iteration for the remaining slots
would then operate on the stale swapBlock as the pointer was not reset.
As we already know that the remaining slots can't be in use, directly
skip to the next swap block to avoid needless hash lookups.
Change-Id: Ib25377beb092aaf3533de1786b5f4c1099464599
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2584
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The pageIndex is incremented on loop, so rounding up to the next swap
block would skip the first entry of the next block which would leak its
swap slot.
Change-Id: Ief3d29e711d323756034ea5ba6e300c489198aff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2583
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Except for the offsets the code was identical. Also simplify the
conditions with early returns.
Change-Id: Ia7c44578ab06e571f6bf992db6c6d3493fd93230
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2582
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Adds VMCache::MovePageRange() and VMCache::Rebase() to facilitate
this.
Applied on top of hrev45098 and rebased with the hrev45564 page_num_t to
off_t change included.
Change-Id: Ie61bf43696783e3376fb4144ddced3781aa092ba
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2581
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The name changes when translations are enabled. Use the index instead.
Fixes#8982.
Thanks to X512 for catching the problem!
Change-Id: I3c4e943f8476e46e7378a50e83a7758f694a8dc0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2606
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
- Use gcc builtin
- Define as a static inline function in the .h so no function call overhead is needed
- Keep the function in libroot for backwards compatibility
- Remove a duplicate implementation in the freebsd compatibility layer
gcc2 does not document the builtin, but it is in fact already available
there as well.
Fixes#3281.
Change-Id: I94f8a2548637aa70e85febbfab06f07c1a427005
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2605
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The issue was introduced when the original CopyFile() and CopyFolder() methods
were integrated into a single recursive Copy() method in
bf551d3889
The installer originally followed the principle that attributes are not copied
for target directories that already exist. Unfortunately the new logic to
filter out that case disables attribute copying in recursive calls of this
method, thus breaking things like bookmarks and tracker templates.
Fixes#15913
Change-Id: I0dfe5ce30fdc78cfd4e3695b4b4e8c23b4848100
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2600
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: leorize <leorize+oss@disroot.org>
This code comes from an old Be Newsletter and since then the API
received the addition of SetMouseEventMask. In several places the
MouseDownThread was misused: it would spawn a new thread on every mouse
click and not clear the previous one. This could for example lead to
BSpinner skipping values if you clicked it at the right speed.
There are functional changes in BSpinner, before it updated for the
first time 100ms after mouse down, and then as you moved the mouse
around the button, now it activates immediately on first click and then
every 200ms (which may be a bit short). In other places, no functional
changes intended.
Change-Id: Ie600dc68cbb87d1e237633953e5189918bf36575
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2599
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The setting still fails to set "Accept First Click" by default. So
hopefully this commit fixes it once and for all.
Change-Id: Ia8d2a1fdf575a524d675fcd8692a86677c9f4e22
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2601
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
As Axel mentioned, there is one more value to be changed. It should be
complete now. Ticket: #15953
Change-Id: Ibe09beb6a434f1572c5b3b3dfd7fced3b2af5935
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2580
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
DrawScrollBarButton passes B_ACTIVATED flag to HaikuControlLook which
draws the button as down.
This regression was introduced in hrev54032.
Fixes#15960
Change-Id: I87dbaa9e8c9169c67dd7cb463d3604d9727ae28f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2577
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Per POSIX.1-2008, getpeername() shall fails if the socket is not
connected.
Fixes#15081
Change-Id: Iafaed09df26f47b10efc2ceed6dfa2852857d39a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2549
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
When selection moves down, BListView was sometimes scroll to upper item,
not lower.
Change-Id: I8f3cf87d43e93c3d2cabfd7ca76f44f1575525e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2311
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: John Scipione <jscipione@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Also remove superflous data from libpackage.rdef
This should fix#15958
Change-Id: I76991030541dca12a2dfdd9282f02274a461ed2a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2561
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Also remove the MINGW support, as it was far too incomplete.
This *should* work under case-sensitive NTFS, but instead,
it seems #14963 occurs. So perhaps there is a GCC bug
related to case-sensitive vs. case-insensitivity after all.
Don't delete or Quit() a BWindow, it can do so by itself. Also, do not
rebuild a BMessenger everytime we want to message a window, that defeats
the purpose. There are still places where the UpdateManager calls
functions from the window object directly however, ignoring the fact
that the window may have been closed.
Fixes#13653.
Change-Id: I868e94a07d9617f343332ea00d35ffd92e60ed8e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2552
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
It was not specified as such before C11, but that's only because there
was no C standard way to do it until then.
Fixes#15955.
Change-Id: Ied7b7fd94988ed7724460917aebc859b74eaa585
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2558
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Right shift on a signed value can extend the sign bit, which would make
this function do an infinite loop if passed a negative value. Use an
unsigned instead to get the behavior we want.
Fixes#15957, but this means we're using undefined data from the
settings file. I assumed it would have the unused button values set to 0
but this isn't apparently the case. Preetpal is already working on that
as we noticed the problem when testing her patch for adding a 6th
button.
Change-Id: I62fdc778ff3b9da92f3aa5570163dc60baf8cf2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2560
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
From a quick look, the ATA driver only looks to safe mode settings for
that, and not the kernel file. The attached patch should address that.
ticket : #10253
Change-Id: I5e5c2474fecbd441a36a3600f7f16a964e0945dd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/56
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Some misuse of BReferencable / BReference are causing the
debugger to fire while debugging another issue. This
should fix some of it.
Change-Id: I895e209afe9e350e35b111739140c85133107227
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2556
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
A program can mmap virtual memory which will only trigger signal handlers.
This is for instance needed for ASAN.
Change-Id: I4a42b4860b5acab17465683e9cf73c486bea7d40
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2554
Reviewed-by: waddlesplash <waddlesplash@gmail.com>