mirror of
https://review.haiku-os.org/haiku
synced 2025-02-22 13:38:56 +01:00
This is both more correct, as we need to not read past the 'size' position of the passed pointer, and much faster, in the case where the passed pointer is into some very large block of memory. This provides an unbelievable speedup to a microbenchmark posted on IRC that makes heavy use of this function in tandem with some rather large allocations. (Some variants of it go from multiple minutes to under a second!)