mirror of
https://github.com/reactos/reactos.git
synced 2024-10-04 00:13:57 +00:00
[RTL]
Rewrite the rtl bitmap implementation. The old one was a little .... suboptimal. The new one should outperform the old one by several orders of magnitude, especially RtlFindClearBits that was literally searching bit by bit. svn path=/trunk/; revision=44464
This commit is contained in:
parent
e7ff40f1e3
commit
66fe9a0793
File diff suppressed because it is too large
Load diff
|
@ -47,6 +47,10 @@
|
||||||
#define STATUS_INVALID_PARAMETER_2 ((NTSTATUS)0xC00000F0)
|
#define STATUS_INVALID_PARAMETER_2 ((NTSTATUS)0xC00000F0)
|
||||||
#define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005)
|
#define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005)
|
||||||
|
|
||||||
|
unsigned char BitScanForward(ULONG * Index, const unsigned long Mask);
|
||||||
|
unsigned char BitScanReverse(ULONG * const Index, const unsigned long Mask);
|
||||||
|
#define RtlFillMemoryUlong(dst, len, val) memset(dst, val, len)
|
||||||
|
|
||||||
NTSTATUS NTAPI
|
NTSTATUS NTAPI
|
||||||
RtlAnsiStringToUnicodeString(
|
RtlAnsiStringToUnicodeString(
|
||||||
IN OUT PUNICODE_STRING UniDest,
|
IN OUT PUNICODE_STRING UniDest,
|
||||||
|
|
|
@ -185,3 +185,25 @@ RtlAssert(PVOID FailedAssertion,
|
||||||
|
|
||||||
//DbgBreakPoint();
|
//DbgBreakPoint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned char BitScanForward(ULONG * Index, unsigned long Mask)
|
||||||
|
{
|
||||||
|
*Index = 0;
|
||||||
|
while (Mask && ((Mask & 1) == 0))
|
||||||
|
{
|
||||||
|
Mask >>= 1;
|
||||||
|
++(*Index);
|
||||||
|
}
|
||||||
|
return Mask ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char BitScanReverse(ULONG * const Index, unsigned long Mask)
|
||||||
|
{
|
||||||
|
*Index = 0;
|
||||||
|
while (Mask && ((Mask & (1 << 31)) == 0))
|
||||||
|
{
|
||||||
|
Mask <<= 1;
|
||||||
|
++(*Index);
|
||||||
|
}
|
||||||
|
return Mask ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue