2021-06-27 21:25:29 +00:00
/***
Copyright ( C ) 2021 J Reece Wilson ( a / k / a " Reece " ) . All rights reserved .
File : Entrypoint . cpp
Date : 2021 - 5 - 13
Author : Reece
* * */
2021-10-23 18:42:05 +00:00
# define _AURORA_RUNTIME_BUILD_API_INTERFACES
2021-06-27 21:25:29 +00:00
# include <AuroraCommon.hpp>
# include <AuroraRuntime.hpp>
# include "RuntimeInternal.hpp"
2022-09-19 01:34:57 +00:00
# include "AuCrypto.hpp"
2022-11-17 07:46:07 +00:00
# include "Processes/AuProcesses.hpp"
# include "RNG/AuRNG.hpp"
2021-06-27 21:25:29 +00:00
# include "Locale/Locale.hpp"
# include "Console/Console.hpp"
# include "IO/FS/FS.hpp"
2023-06-28 09:33:12 +00:00
# include "IO/FS/Resources.hpp"
2022-04-14 16:13:19 +00:00
# include "IO/IO.hpp"
2022-08-28 19:02:06 +00:00
# include "IO/Net/Net.hpp"
2022-11-17 07:46:07 +00:00
# include "Hashing/AuHashing.hpp"
2021-06-27 21:25:29 +00:00
# include "Debug/Debug.hpp"
2021-06-27 22:53:04 +00:00
# include "Async/Async.hpp"
2022-11-17 07:46:07 +00:00
# include "HWInfo/AuHWInfo.hpp"
2022-01-21 22:37:29 +00:00
# include "Telemetry/Telemetry.hpp"
2022-11-17 07:46:07 +00:00
# include "Threading/Threads/AuOSThread.hpp"
# include "SWInfo/AuSWInfo.hpp"
2021-07-01 10:42:48 +00:00
# if defined(AURORA_PLATFORM_WIN32)
2022-03-18 04:30:39 +00:00
# include "Extensions/Win32/DarkTheme.hpp"
2022-11-28 16:01:08 +00:00
# include <timeapi.h>
2021-07-01 10:42:48 +00:00
# endif
2024-01-03 02:39:54 +00:00
# if defined(AURORA_IS_MODERNNT_DERIVED)
# include <Source/IO/NT/HANDLEPipeServer.hpp>
# endif
2022-12-07 11:38:10 +00:00
# include "Debug/MemoryCrunch.hpp"
2022-08-10 09:50:49 +00:00
# include "Process/Process.hpp"
2022-11-17 07:46:07 +00:00
# include "Exit/AuExit.hpp"
2023-09-16 20:22:03 +00:00
# include "CmdLine/AuCmdLine.hpp"
2022-11-17 07:46:07 +00:00
# include "Grug/AuGrug.hpp"
# include "Threading/AuSleep.hpp"
2024-03-19 15:47:42 +00:00
# include "Memory/AuMemoryCache.hpp"
2023-08-22 11:57:47 +00:00
# include "Threading/Primitives/SMTYield.hpp"
2023-10-28 14:30:28 +00:00
# include <mimalloc.h>
2023-12-18 05:57:37 +00:00
# include "Process/AuProcessStartTime.hpp"
2023-02-16 18:30:56 +00:00
# include "AuProcAddresses.hpp"
2024-10-16 01:05:11 +00:00
# include "Crypto/CA/CA.hpp"
2023-02-16 18:30:56 +00:00
2022-08-07 04:18:34 +00:00
# if defined(AURORA_IS_LINUX_DERIVED)
2024-10-16 01:05:11 +00:00
# include "Crypto/CA/AuPinOS.Linux.hpp"
2022-08-07 04:18:34 +00:00
void LinuxSuperSecretIOTick ( ) ;
# endif
2022-08-28 19:02:06 +00:00
namespace Aurora : : IO : : TLS
{
void TLSInit ( ) ;
}
2022-08-14 11:01:54 +00:00
static thread_local bool tlsHackIsMainThread { } ;
2023-05-08 14:16:06 +00:00
static void Pump ( ) ;
2021-06-27 21:25:29 +00:00
static void Init ( )
{
2023-09-09 16:37:14 +00:00
Aurora : : Threading : : Primitives : : InitCfg ( ) ;
2023-02-16 18:30:56 +00:00
Aurora : : InitProcAddresses ( ) ;
2022-08-14 11:01:54 +00:00
gRuntimeRunLevel = 1 ;
tlsHackIsMainThread = true ;
2022-11-28 16:01:08 +00:00
2023-07-09 12:51:05 +00:00
# if defined(AURORA_PLATFORM_WIN32)
2021-07-01 10:42:48 +00:00
Aurora : : Extensions : : Win32 : : InitDarkMode ( ) ;
# endif
2022-12-14 01:35:18 +00:00
Aurora : : Memory : : Cache : : InitCache ( ) ;
2022-08-29 10:07:27 +00:00
Aurora : : RNG : : Init ( ) ;
2022-12-16 00:41:01 +00:00
Crypto : : InitCrypto ( ) ;
2022-08-28 19:02:06 +00:00
Aurora : : IO : : TLS : : TLSInit ( ) ;
2024-10-16 01:05:11 +00:00
Aurora : : Crypto : : CA : : InitDefaultBuiltinCA ( ) ;
# if defined(AURORA_IS_LINUX_DERIVED)
Aurora : : Crypto : : CA : : InitLinuxPinner ( ) ;
# endif
2023-12-18 05:57:37 +00:00
AuProcess : : WarmStartupCaches ( ) ;
2022-05-13 17:44:44 +00:00
Aurora : : Threading : : InitSleep ( ) ;
2024-06-29 15:06:42 +00:00
Aurora : : CmdLine : : Init ( ) ;
2022-08-10 09:50:49 +00:00
Aurora : : Process : : InitProcess ( ) ;
2022-03-18 04:30:39 +00:00
Aurora : : SWInfo : : InitSwInfo ( ) ;
2023-07-09 12:51:05 +00:00
# if defined(AURORA_PLATFORM_WIN32)
Aurora : : Win32DropInit ( ) ;
Aurora : : Win32DropSchedulerResolution ( ) ;
# endif
2022-01-18 16:02:24 +00:00
Aurora : : Threading : : Threads : : InitThreading ( ) ;
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
Aurora : : Exit : : InitExit ( ) ;
2022-08-28 19:02:06 +00:00
Aurora : : IO : : Net : : InitNetworking ( ) ;
2021-06-27 21:25:29 +00:00
Aurora : : Console : : Init ( ) ;
Aurora : : IO : : FS : : InitResources ( ) ;
2022-04-14 16:13:19 +00:00
Aurora : : IO : : Init ( ) ;
2023-12-30 19:38:58 +00:00
Aurora : : Grug : : InitGrug ( ) ;
2021-06-27 21:25:29 +00:00
Aurora : : Console : : Init2 ( ) ;
2022-03-18 04:30:39 +00:00
Aurora : : HWInfo : : Init ( ) ;
Aurora : : Telemetry : : Init ( ) ;
2021-06-27 21:25:29 +00:00
Aurora : : Debug : : InitDebug ( ) ;
Aurora : : Locale : : Init ( ) ;
Aurora : : Processes : : Init ( ) ;
Aurora : : Hashing : : InitHashing ( ) ;
2021-06-27 22:53:04 +00:00
Aurora : : Async : : InitAsync ( ) ;
2023-08-22 11:57:47 +00:00
Aurora : : Threading : : Primitives : : InitAdaptiveThresholdFirstTime ( ) ;
2022-08-14 11:01:54 +00:00
gRuntimeRunLevel = 2 ;
2023-05-24 07:19:47 +00:00
# if defined(AURORA_PLATFORM_WIN32)
if ( ! gRuntimeConfig . console . asyncVSLog )
{
if ( IsDebuggerPresent ( ) )
{
AuLogWarn ( " A debugger is attached and RuntimeStartInfo::console.asyncVSLog is assigned false - log-lines will be flushed to Visual Studios output window immediately. Expect a slowdown. Do not benchmark. " ) ;
}
else
{
gRuntimeConfig . console . asyncVSLog = true ;
}
}
# endif
2023-05-08 14:16:06 +00:00
Pump ( ) ;
2021-06-27 21:25:29 +00:00
}
static void Pump ( )
{
Aurora : : Console : : Pump ( ) ;
2022-08-07 04:18:34 +00:00
# if defined(AURORA_IS_LINUX_DERIVED)
: : LinuxSuperSecretIOTick ( ) ;
# endif
2022-11-28 16:01:08 +00:00
2023-08-11 15:51:42 +00:00
# if defined(AURORA_PLATFORM_WIN32)
2023-07-09 11:34:14 +00:00
Aurora : : Win32DropSchedulerResolution ( ) ;
2023-08-11 15:51:42 +00:00
# endif
2021-06-27 21:25:29 +00:00
}
2022-08-14 13:41:19 +00:00
static void RuntimeLateClean ( ) ;
2021-06-27 21:25:29 +00:00
static void Deinit ( )
{
2022-08-14 22:59:48 +00:00
//tlsHackIsMainThread = true;
2023-02-16 18:44:28 +00:00
2022-08-14 11:01:54 +00:00
gRuntimeRunLevel = 3 ;
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
Aurora : : Exit : : PostLevel ( AuThreads : : GetThread ( ) , Aurora : : Exit : : ETriggerLevel : : eSafeTermination ) ;
2022-08-14 11:01:54 +00:00
gRuntimeRunLevel = 4 ;
2023-02-16 18:44:28 +00:00
2021-07-01 09:18:42 +00:00
Aurora : : Async : : ShutdownAsync ( ) ;
2023-02-16 18:44:28 +00:00
2022-08-14 13:41:19 +00:00
RuntimeLateClean ( ) ;
}
2023-02-16 18:30:56 +00:00
static void RuntimeLateClean ( )
2022-08-14 13:41:19 +00:00
{
2023-02-16 18:44:28 +00:00
// TODO: elevate leval, freeze all threads
Aurora : : Console : : Exit ( ) ; // Final flush (i hope? coping?)
Aurora : : Grug : : DeinitGrug ( ) ; // TODO: this was once broken above "deinit" for some unix crash reason.
// now that the runtime is far more stable, im putting this down here to ensure
// console exit doesnt slam into a deadlocked grug thread.
Aurora : : Processes : : Deinit ( ) ;
2022-12-07 11:38:10 +00:00
2024-01-03 02:39:54 +00:00
# if defined(AURORA_IS_MODERNNT_DERIVED)
Aurora : : IO : : NT : : ShutdownNTIPCHandleServer ( ) ;
# endif
2023-02-16 18:44:28 +00:00
// Static variables we should probably manually release ->
// (there is no real logic under the following functions)
Aurora : : IO : : Deinit ( ) ;
Aurora : : Exit : : DeinitExit ( ) ;
2023-06-28 09:33:12 +00:00
Aurora : : IO : : FS : : DeinitResources ( ) ;
Aurora : : CmdLine : : Deinit ( ) ;
2024-10-16 01:05:11 +00:00
Aurora : : Crypto : : CA : : DeinitDefaultBuiltinCA ( ) ;
# if defined(AURORA_IS_LINUX_DERIVED)
Aurora : : Crypto : : CA : : DeinitLinuxPinner ( ) ;
# endif
2023-06-28 09:33:12 +00:00
2023-02-16 18:44:28 +00:00
Aurora : : RNG : : Release ( ) ; // RNG and crypto should remain alive whilst IO work is ongoing.
// At this point, we should assume libtomcrypt and mbedtls wont be called
// The default gFastDevice shouldn't be hit for any reason
// ...we should be clear to start freeing those contexts and related system handles
// Exterminate reserve debug memory which may very well be in use
// So long as we assume aurora runtime users are dead, bye bye underlying (low-memory condition) heap
2022-12-07 11:38:10 +00:00
AuDebug : : gReservePoolStart = 0 ;
AuDebug : : gReservePoolEnd = 0 ;
AuDebug : : gReserveHeap . reset ( ) ;
2022-08-14 11:01:54 +00:00
gRuntimeRunLevel = 5 ;
2023-02-16 18:44:28 +00:00
// TODO: forcefully terminate spawned threads
// TODO: debate terminate process for safety reasons i cant be bothered to explain (including AuDebug heap)
2021-06-27 21:25:29 +00:00
}
namespace Aurora
{
2021-10-24 10:53:14 +00:00
static bool gRuntimeHasStarted { } ;
2021-10-25 17:06:11 +00:00
2022-08-14 11:01:54 +00:00
bool RuntimeIsMainThread ( )
{
return tlsHackIsMainThread ;
}
2021-06-27 21:25:29 +00:00
AUKN_SYM void RuntimeStart ( const RuntimeStartInfo & info )
{
gRuntimeConfig = info ;
2024-09-27 21:50:04 +00:00
if ( gRuntimeConfig . threadingConfig . bResetToRuntimeDefaults )
{
// <= C++17 users will struggle to fill this bit field and I dont want a massive properties object library yet just to handle runtime init.
AuResetMember ( gRuntimeConfig . threadingConfig ) ;
}
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
if ( gRuntimeHasStarted )
{
SysPanic ( " Do not nest RuntimeStart/RuntimeShutdowns. Modules should respect RuntimeHasStarted() " ) ;
}
2022-08-28 19:02:06 +00:00
2022-01-24 18:37:06 +00:00
try
{
Init ( ) ;
}
catch ( . . . )
{
SysPanic ( " A fatal error occurred during the initialization of Aurora Runtime " ) ;
}
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
2021-10-24 10:53:14 +00:00
gRuntimeHasStarted = true ;
2021-06-27 21:25:29 +00:00
}
[*/+/-] MEGA COMMIT. ~2 weeks compressed.
The intention is to quickly improve and add util apis, enhance functionality given current demands, go back to the build pipeline, finish that, publish runtime tests, and then use what we have to go back to to linux support with a more stable api.
[+] AuMakeSharedArray
[+] Technet ArgvQuote
[+] Grug subsystem (UNIX signal thread async safe ipc + telemetry flusher + log flusher.)
[+] auEndianness -> Endian swap utils
[+] AuGet<N>(...)
[*] AUE_DEFINE conversion for
ECompresionType, EAnsiColor, EHashType, EStreamError, EHexDump
[+] ConsoleMessage ByteBuffer serialization
[+] CmdLine subsystem for parsing command line arguments and simple switch/flag checks
[*] Split logger from console subsystem
[+] StartupParameters -> A part of a clean up effort under Process
[*] Refactor SysErrors header + get caller hack
[+] Atomic APIs
[+] popcnt
[+] Ring Buffer sink
[+] Added more standard errors
Catch,
Submission,
LockError,
NoAccess,
ResourceMissing,
ResourceLocked,
MalformedData,
InSandboxContext,
ParseError
[+] Added ErrorCategorySet, ErrorCategoryClear, GetStackTrace
[+] IExitSubscriber, ETriggerLevel
[*] Write bias the high performance RWLockImpl read-lock operation operation
[+] ExitHandlerAdd/ExitHandlerRemove (exit subsystem)
[*] Updated API style
Digests
[+] CpuId::CpuBitCount
[+] GetUserProgramsFolder
[+] GetPackagePath
[*] Split IStreamReader with an inl file
[*] BlobWriter/BlobReader/BlobArbitraryReader can now take shared pointers to bytebuffers. default constructor allocates a new scalable bytebuffer
[+] ICharacterProvider
[+] ICharacterProviderEx
[+] IBufferedCharacterConsumer
[+] ProviderFromSharedString
[+] ProviderFromString
[+] BufferConsumerFromProvider
[*] Parse Subsystem uses character io bufferer
[*] Rewritten NT's high perf semaphore to use userland SRW/ConVars [like mutex, based on generic semaphore]
[+] ByteBuffer::ResetReadPointer
[*] Bug fix bytebuffer base not reset on free and some scaling issues
[+] ProcessMap -> Added kSectionNameStack, kSectionNameFile, kSectionNameHeap for Section
[*] ProcessMap -> Refactor Segment to Section. I was stupid for keeping a type conflict hack API facing
[+] Added 64 *byte* fast RNG seeds
[+] File Advisorys/File Lock Awareness
[+] Added extended IAuroraThread from OS identifier caches for debug purposes
[*] Tweaked how memory is reported on Windows. Better consistency of what values mean across functions.
[*] Broke AuroraUtils/Typedefs out into a separate library
[*] Update build script
[+] Put some more effort into adding detail to the readme before rewriting it, plus, added some media
[*] Improved public API documentation
[*] Bug fix `SetConsoleCtrlHandler`
[+] Locale TimeDateToFileNameISO8601
[+] Console config stdOutShortTime
[*] Begin using internal UTF8/16 decoders when platform support isnt available (instead of stl)
[*] Bug fixes in decoders
[*] Major bug fix, AuMax
[+] RateLimiter
[+] Binary file sink
[+] Log directory sink
[*] Data header usability (more operators)
[+] AuRemoveRange
[+] AuRemove
[+] AuTryRemove
[+] AuTryRemoveRange
[+] auCastUtils
[+] Finish NewLSWin32Source
[+] AuTryFindByTupleN, AuTryRemoveByTupleN
[+] Separated AuRead/Write types, now in auTypeUtils
[+] Added GetPosition/SetPosition to FileWriter
[*] Fix stupid AuMin in place of AuMax in SpawnThread.Unix.Cpp
[*] Refactored Arbitrary readers to SeekingReaders (as in, they could be atomic and/or parallelized, and accept an arbitrary position as a work parameter -> not Seekable, as in, you can simply set the position)
[*] Hack back in the sched deinit
[+] File AIO loop source interop
[+] Begin to prototype a LoopQueue object I had in mind for NT, untested btw
[+] Stub code for networking
[+] Compression BaseStream/IngestableStreamBase
[*] Major: read/write locks now support write-entrant read routines.
[*] Compression subsystem now uses the MemoryView concept
[*] Rewrite the base stream compressions, made them less broken
[*] Update hashing api
[*] WriterTryGoForward and ReaderTryGoForward now revert to the previous relative index instead of panicing
[+] Added new AuByteBuffer apis
Trim, Pad, WriteFrom, WriteString, [TODO: ReadString]
[+] Added ByteBufferPushReadState
[+] Added ByteBufferPushWriteState
[*] Move from USC-16 to full UTF-16. Win32 can handle full UTF-16.
[*] ELogLevel is now an Aurora enum
[+] Raised arbitrary limit in header to 255, the max filter buffer
[+] Explicit GZip support
[+] Explicit Zip support
[+] Added [some] compressors
et al
2022-02-17 00:11:40 +00:00
AUKN_SYM bool RuntimeHasStarted ( )
{
return gRuntimeHasStarted ;
}
2021-06-27 21:25:29 +00:00
AUKN_SYM void RuntimeShutdown ( )
{
2022-11-30 11:11:18 +00:00
RuntimeSysPump ( ) ;
2021-10-24 10:53:14 +00:00
gRuntimeHasStarted = false ;
2021-06-27 21:25:29 +00:00
Deinit ( ) ;
}
AUKN_SYM void RuntimeSysPump ( )
{
Pump ( ) ;
}
2022-08-14 13:41:19 +00:00
2023-12-13 04:25:11 +00:00
AUKN_SYM void RuntimeWaitForSecondaryTick ( )
{
Grug : : WaitForGrugTick ( ) ;
}
2024-10-12 15:28:18 +00:00
AUKN_SYM void RuntimeCollectMemory ( )
{
mi_collect ( true ) ;
}
2022-08-14 13:41:19 +00:00
void RuntimeLateClean ( )
{
: : RuntimeLateClean ( ) ;
}
2021-06-27 21:25:29 +00:00
}
# if defined(AURORA_PLATFORM_WIN32)
BOOL WINAPI DllMain (
HINSTANCE hinstDLL ,
DWORD fdwReason ,
LPVOID lpReserved )
{
if ( fdwReason = = DLL_PROCESS_ATTACH )
{
2023-10-28 14:30:28 +00:00
//DisableThreadLibraryCalls(hinstDLL);
}
if ( fdwReason = = DLL_THREAD_DETACH )
{
mi_thread_done ( ) ;
2021-06-27 21:25:29 +00:00
}
return TRUE ;
}
# endif