Implemented using __builtin_clz where available, otherwise using
an algorithm derived from "Bit Twiddling Hacks" which is similar
to the one ramfs uses. GCC and Clang seem to unroll the loop on
x86 at least (but it doesn't matter there as the builtin exists,
implemented using the "bsr" instruction.)
After settings Backgrounds to None for all worskapces, I was getting a 100%
reproducible segment violation on "fShowingBitmap->fBitmap->Bounds()" with every
resolution change.
Change-Id: I2a3640a3c33e571d772c1b38b21087346215dca8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8176
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
... whatever motivated this to only work on disabled text views
has been resolved.
Change-Id: I3ae9d056870f1163d3fa074ab9a1dad96c0192f8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8168
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
* Fully implement break-before-make PTE updating, fixing the
race condition that necessitates it.
* Incorporate align-down logic into the normal flow of the table
traversal.
* Drop support for huge pages and for table freeing for now. They
can be reimplemented once we have a fully functional baseline.
* Further adoption of the new ProcessRange coming in subsequent
patches.
Change-Id: I852c63aaeab48b847b4bb99b328dfe071d27bb29
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8139
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
* clang, unlike GCC, does not allow a weak declaration to override
a strong definition. We need to make herror's definition in
addition to declaring the weak alias above.
Change-Id: Iac1c00e66bdd73d6e214e2302e18a0d51b18c9d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8148
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Does the same thing but _inherited is used so we can change the class.
Change-Id: I6c0bf7b35917da55a3bd4aa15b5bb80063f2b02a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8150
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This allows both guard pages and freed allocations, when memory reuse is
disabled, to be returned to the system, massively reducing the pages that
are actually needed.
The guarded heap obviously still wastes a lot of memory due to using a
dedicated page for every tiny allocation. But with this change it
becomes realistic to run the full userland under the guarded heap for
more than a couple of minutes and with more complex applications than
before.
Change-Id: I479e822f9dbeea3968d41b66fc55b0d285a1f57e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8166
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This shifts another big chunk of packagefs memory usage into dedicated
object caches. It saves a small amount of memory since now we use
caches sized exactly to the object size plus alignment rather than
rounding up to the block allocator size, and also makes clearer in memory
usage statistics how much memory packagefs is using.
We don't need to set the top here, it is already set by CalcRect()
a couple lines up. Our calculation was slightly off causing bug.
Fixes #12558
Change-Id: I022cc661cf55a9d016fd722c701f05fc1f9fea4f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8165
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This is the only case the POSIX specification indicates is portable.
We may be able to implement some of the others that Linux or the BSDs
support if it turns out there are applications that want them, though.
Fixes #19032.
The previous change to this logic (9921f444625e360674f92db84ffae695492233a5)
apparently caused intermittent crashes with various applications. It
seems that EDX is not expected to be clobbered by functions that do not have 64-bit return values, and if it is, crashes result, like #19024.
This commit reworks the logic to not change %edx in the iframe at all
if we don't have a 64-bit return value, and then adjusts the debug logic
to clear %edx before invoking the post-syscall debugger hook. This means
we have to run the post-syscall debugger hook before clearing the
flags, but that should be fine (and perhaps even useful.)
Fixes #19024, and possibly other crashes that have cropped up on
32-bit x86 in the last few weeks, at least.
Change-Id: I3280033bc2dd05aca254555d6ee3b173a270ebf9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8158
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Michael Lotz <mmlr@mlotz.ch>
The fRenewalTime and fRebindingTime members were never initialized but
assumed to be initially set to 0 when not provided by the DHCP server.
This could lead to negative time values depending on the uninitialized
memory content and would always happen under libroot_debug where memory
is initially cleared to 0xcc. The negative times then lead to endless
loops of sending requests.
Change-Id: I74a5fbd0c75f7de925f591f09db663978ea3f0ea
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8157
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Otherwise the controls look like they are "disabled" and can't be
edited.
Ideally this class would be refactored to use BAbstractSpinner rather
than drawing its own arrows, but that's a problem for another day.
See inline comment: otherwise it might be deleted when we
release it in Disconnect() but before we unlock it.
Also fix _LockConnectedEndpoints() to unset the locker object if
returning an error, rather than returning a locked endpoint that
we don't hold a reference to.
Fixes #18927.
... instead of making a copy like normal. This changes the default
behavior, you may override it by context-click dragging and selecting
Copy or holding the option key to force copy.
Implements #18729
Change-Id: Ib13bec347f300d25de77064ced79693ecbc3a85c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8144
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Minimum menu field width is set by "multiple selections" string width
on volumes menu field or a smaller size that matches R1B4 on rest.
Maximum menu field width chosen to match current based on font size.
Set the max content width to truncate long mime-type names that don't
fit. Add room for the pop-up indicator.
Create member variables to hold menu fields. Resize the menu fields in
AttachedToWindow() after they have been marked because the width
depends on the marked item.
Set member pointers to NULL in constructor where not already set.
ASSERT variables we use are not NULL, they aren't but check anyway.
Use DefaultLabelSpacing() for the spacing between icon and text to make
them font sensitive. DefaultLabelSpacing() is 5px at 12pt font matching
current.
Fixes #18999
Change-Id: I0e52b5aa557c8b5d76f09e0b60fcb965e3ff65e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8143
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* Move towards defined constants for getting and setting PTE types.
Change-Id: Ia655b00b4de5ec49a01bf902626d63138e3bbeb1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8113
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
* Move .got to be adjacent to other relro sections.
* Use PC-relative accesses to set the fault handler in
arch_debug_call_with_fault_handler.
Change-Id: I52eec7e2525c15ec50eb4b83e4740519a76cd4a2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8111
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
* Move "Open..." menu to the top, above the save items, as is usual for
Haiku apps.
* Capitalize "Trash", as in the rest of Haiku; it's the concept of "Trash",
i.e. of all mounted volumes.
* Replace the volume-popup label "On" with "Target:". After limiting the
query to folders was added, "on" wasn't grammatically correct any more.
Change-Id: Id8a65d287af0b154956b1018599876d276a33bda
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8110
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
When set, the package names provided in the file list are assumed to be
in their canonical form and the package files are not accessed to build
canonical names from their package info.
This allows for delta updates where package files are only listed in the
file list but are not present or valid in the packages directory.
This does not fundamentally change the risks of such updates as the
checksum of packages was already not revalidated and replaced packages
were therefore already not detected.
Change-Id: I3a10794858384fe17374eb0469dd4bd4e024253a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8138
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Fixed dynamicDate used without initialization at line 730,
since GetPredicateString() might not set value to dynamicDate.
Pointed out by Clang Static Analyzer.
Change-Id: I4698fdada4b91183c7bdba5aa980ddc6b55e6312
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7946
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This reverts commit 946839b8500ef32960716ab9c86fcb48c9b29807.
Keeping these allow to keep track of why Werror is not enabled for the
entire network drivers subdirectory.
These are architecture-specific routines, so they deserve proper
architecture-specific naming. The user memory access routines are
already under arch_cpu (arch_cpu_user_memcpy, etc.), and the methods
usually change a CPU flag, so it makes sense to put these there too.
RISC-V had get_ac but nothing else defined or used it, so it's removed.
No functional change intended.
Change-Id: Id4715214e32f73d4a93bc7ba8249411a0878d174
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8106
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: X512 X512 <danger_mail@list.ru>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
So we need to check that it didn't when creating areas.
Change-Id: I4342463113046b543722faa7a51ca269ed67e8bf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8137
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Enhance the warning message and return a more relevant error code.
Fixes #19017.
Change-Id: I13d01ce206a27e5c9a35debc8081219422bfb10a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8136
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This restores cut items state to full opacity on paste.
Reverts the part of hrev53329 for cut items. We only copy duplicates
on copy operations, not cut, but we have to make all cut operations
copy after paste is over to restore the state. The clipboard mode is
altered but not the contents.
Fixes #15267
Change-Id: I8a036a548719fe49c512bd38ff1a072890ab2325
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8100
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>