[+] Added doxing fingerprint

[*] Use RAII safe lock guard instead of ->Lock(), ->Unlock() that would not be unwound
This commit is contained in:
Reece Wilson 2022-01-28 01:09:12 +00:00
parent 086de4600f
commit 3f2f66f4ec
4 changed files with 45 additions and 43 deletions

BIN
Media/Hello Aurora.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -82,9 +82,8 @@ AuUInt32 WELL_NextLong_Unlocked(WELLRand *rand)
*/ */
AuUInt32 WELL_NextLong(WELLRand *rand) AuUInt32 WELL_NextLong(WELLRand *rand)
{ {
rand->lock.Lock(); AU_LOCK_GUARD(rand->lock);
AuUInt32 ret = WELL_NextLong_Unlocked(rand); AuUInt32 ret = WELL_NextLong_Unlocked(rand);
rand->lock.Unlock();
return ret; return ret;
} }
@ -95,8 +94,8 @@ void WELL_NextBytes(WELLRand *rand, void *in, AuUInt32 length)
i = 0; i = 0;
base = reinterpret_cast<AuUInt8 *>(in); base = reinterpret_cast<AuUInt8 *>(in);
rand->lock.Lock(); AU_LOCK_GUARD(rand->lock);
for (; i < length; i += 4) for (; i < length; i += 4)
{ {
@ -110,6 +109,4 @@ void WELL_NextBytes(WELLRand *rand, void *in, AuUInt32 length)
AuUInt32 padRng = WELL_NextLong_Unlocked(rand); AuUInt32 padRng = WELL_NextLong_Unlocked(rand);
AuMemcpy(base + i, &padRng, length - i); AuMemcpy(base + i, &padRng, length - i);
} }
rand->lock.Unlock();
} }

View File

@ -50,7 +50,7 @@ AuUInt32 MT_NextLong(MTRand *rand)
AuUInt32 y; AuUInt32 y;
static const AuUInt32 mag[2] = {0x0, 0x9908b0df}; /* mag[x] = x * 0x9908b0df for x = 0,1 */ static const AuUInt32 mag[2] = {0x0, 0x9908b0df}; /* mag[x] = x * 0x9908b0df for x = 0,1 */
rand->lock.Lock(); AU_LOCK_GUARD(rand->lock);
if (rand->index >= STATE_VECTOR_LENGTH || rand->index < 0) if (rand->index >= STATE_VECTOR_LENGTH || rand->index < 0)
{ {
@ -85,6 +85,5 @@ AuUInt32 MT_NextLong(MTRand *rand)
y ^= (y << 15) & TEMPERING_MASK_C; y ^= (y << 15) & TEMPERING_MASK_C;
y ^= (y >> 18); y ^= (y >> 18);
rand->lock.Unlock();
return y; return y;
} }

View File

@ -2,11 +2,13 @@
## AuroraRuntime ## AuroraRuntime
The Aurora Runtime is an platform abstraction layer for cross-platform C++ development targeting<br> ![picture](https://gitea.reece.sx/AuroraSupport/AuroraRuntime/raw/branch/master/Media/Hello%20Aurora.png)
embedded and PC systems. Simply fetch a binary package for your toolchain or integrate the build<br>
scripts into your applications build pipeline to get started. <br>
View this raw file for improved formatting The Aurora Runtime is an platform abstraction layer for cross-platform C++ development targeting
embedded and PC systems. Simply fetch a binary package for your toolchain or integrate the build
scripts into your applications build pipeline to get started.
View this file without markdown for improved formatting
## Features ## Features
@ -48,29 +50,33 @@ Aurora Overloadable Type Declerations: https://git.reece.sx/AuroraSupport/Aurora
~~Aurora Runtime does not attempt to implement your favourite production logger. We instead <br> ~~Aurora Runtime does not attempt to implement your favourite production logger. We instead <br>
implement a subscription based log message dispatcher with some default backends including <br> implement a subscription based log message dispatcher with some default backends including <br>
a file logger, Windows debug logging, Windows conhost stdin/out using UTF-8, UNIX stdin/out <br> a file logger, Windows debug logging, Windows conhost stdin/out using UTF-8, UNIX stdin/out <br>
respecting the applications codepage, a wxWidgets toolkit GUI, and hopefully more to come. ~~ <br> respecting the applications codepage, a wxWidgets toolkit GUI, and hopefully more to come~~<br>
Additionally, consoles that provide an input stream can be used in conjunction with the parse <br> Additionally, consoles that provide an input stream can be used in conjunction with the parse
subsystem to provide basic command-based deserialization, tokenization, and dispatch of UTF-8 <br> subsystem to provide basic command-based deserialization, tokenization, and dispatch of UTF-8
translated strings regardless of the system locale translated strings regardless of the system locale
## Exceptions ## Exceptions
Through the use of compiler internal overloads, ELF hooking, and Win32 `AddVectoredExceptionHandler`, Aurora <br> Through the use of compiler internal overloads, ELF hooking, and Win32
Runtime hooks exceptions at the time of throw, including *some* out of ecosystem exceptions, providing detailed <br> `AddVectoredExceptionHandler`, Aurora Runtime hooks exceptions at the time of throw, including
telemetry of the object type, object string, and backtrace. In addition, the `AuDebug` namespace provides TLS based <br> *some* out of ecosystem exceptions, providing detailed telemetry of the object type, object
last-error and last-backtrace methods. <br> string, and backtrace. In addition, the `AuDebug` namespace provides TLS based last-error and
last-backtrace methods. <br>
EXCEPTIONS ARE NOT CONTROL FLOW...<br> EXCEPTIONS ARE NOT CONTROL FLOW...<br>
- Aurora Runtime WILL attempt to mitigate exceptions in internal logic - Aurora Runtime WILL attempt to mitigate exceptions in internal logic
- Aurora Runtime WILL NOT abuse exceptions to communicate failure - Aurora Runtime WILL NOT abuse exceptions to communicate failure
- Aurora Runtime WILL try to decouple internal exceptions from the API - Aurora Runtime WILL try to decouple internal exceptions from the API
- Aurora Runtime WILL NOT use anything that automatically crashes on exception catch (no-nothrow) - Aurora Runtime WILL NOT use anything that automatically crashes on exception catch (no-nothrow)
- Aurora Runtime WILL provide extended exception information to telemetry backends and through the `AuDebug` namespace - Aurora Runtime WILL provide extended exception information to telemetry backends and through
- Aurora Runtime WILL NOT make any guarantees of being globally-nothrow; however, it should be a safe assumption in non-critical environments the `AuDebug` namespace
- Aurora Runtime WILL NOT make any guarantees of being globally-nothrow; however, it should be a
safe assumption in non-critical environments
`SysPanic` can be used to format a `std::terminate`-like exit condition, complete with telemetry data and safe cleanup. `SysPanic` can be used to format a `std::terminate`-like exit condition, complete with telemetry
data and safe cleanup.
## Loop ## Loop
@ -167,31 +173,31 @@ User-overloadable type declerations and generic access utilities are defined und
## Binding ## Binding
Aurora Runtime provides C++ APIs; however, it should be noted that two libraries are used to extend interfaces and enums <br> Aurora Runtime provides C++ APIs; however, it should be noted that two libraries are used to extend interfaces and enums
to help with porting and internal utility access. One, AuroraEnums, wraps basic enumerations and provides value vectors; <br> to help with porting and internal utility access. One, AuroraEnums, wraps basic enumerations and provides value vectors;
value strings; look up; iteration; and more. The other, AuroraInterfaces, provides *TWO* class types for each virtual interface. <br> value strings; look up; iteration; and more. The other, AuroraInterfaces, provides *TWO* class types for each virtual interface.
Each interface can be backed by a; C++ class method overriding a superclass's `virtual ...(...) = 0;` method, or a `AuFunctional`<br> Each interface can be backed by a; C++ class method overriding a superclass's `virtual ...(...) = 0;` method, or a `AuFunctional`
-based structure. <br> -based structure.
It should be noted that most language bindings and generator libraries (^swig, v8pp, nbind, luabind) work with shared pointers. <br> It should be noted that most language bindings and generator libraries (^swig, v8pp, nbind, luabind) work with shared pointers.
Other user code may wish to stuff pointers into a machineword-sized space, whether its a C library, a FFI, or a size constraint. <br> Other user code may wish to stuff pointers into a machineword-sized space, whether its a C library, a FFI, or a size constraint.
One handle or abstraction layer will be required to integrate the C++ API into the destination platform, and assuming we have a <br> One handle or abstraction layer will be required to integrate the C++ API into the destination platform, and assuming we have a
C++ language frontend parsing our API, we can use `AuSPtr` for all caller-to-method constant reference scanerios. <br> C++ language frontend parsing our API, we can use `AuSPtr` for all caller-to-method constant reference scanerios.
Furthermore, `AuSPtrs` can be created, without a deletor, using `AuUnsafeRaiiToShared(unique/raw pointer)`. To solve the raw <br> Furthermore, `AuSPtrs` can be created, without a deletor, using `AuUnsafeRaiiToShared(unique/raw pointer)`. To solve the raw
pointer issue, `AuSPtrs` are created in the public headers with the help of exported/default visibility interface create and <br> pointer issue, `AuSPtrs` are created in the public headers with the help of exported/default visibility interface create and
destroy functions. These APIs provide raw pointers to public C++ interfaces, and as such, can be binded using virtually any <br> destroy functions. These APIs provide raw pointers to public C++ interfaces, and as such, can be binded using virtually any
shim generator. Method and API mapping will likely involve manual work from the library developer to reimplement AU concepts <br> shim generator. Method and API mapping will likely involve manual work from the library developer to reimplement AU concepts
under their language runtime instead of using the C++ platform, or at least require manual effort to shim or map each runtime <br> under their language runtime instead of using the C++ platform, or at least require manual effort to shim or map each runtime
prototype into something more sane across the language barrier. <br> prototype into something more sane across the language barrier.
Memory is generally viewed through a `std::span` like concept called MemoryViews. `MemoryViewRead` and `MemoryViewWrite` <br> Memory is generally viewed through a `std::span` like concept called MemoryViews. `MemoryViewRead` and `MemoryViewWrite`
provide windows into a defined address range. `MemoryViewStreamRead` and `MemoryViewStreamWrite` expand upon this concept by <br> provide windows into a defined address range. `MemoryViewStreamRead` and `MemoryViewStreamWrite` expand upon this concept by
accepting an additional offset (`AuUInt &: reference`) that is used by internal APIs to indicate how many bytes were written or <br> accepting an additional offset (`AuUInt &: reference`) that is used by internal APIs to indicate how many bytes were written or
read from a given input region. Such requirement came about from so many APIs, networking, compression, encoding, doing the exact <br> read from a given input region. Such requirement came about from so many APIs, networking, compression, encoding, doing the exact
same thing in different not-so-portable ways. Unifying memory access to 4 class types should aid with SWIG prototyping. same thing in different not-so-portable ways. Unifying memory access to 4 class types should aid with SWIG prototyping.
Unrelated note, structure interfacing with questionable C++ ABI reimplementations is somewhat sketchy in FFI projects (^ CppSharp)<br> Unrelated note, structure interfacing with questionable C++ ABI reimplementations is somewhat sketchy in FFI projects (^ CppSharp)
can lead to some memory leaks. <br> can lead to some memory leaks.
## IO ## IO