strat: statically allocate additional threads

This commit is contained in:
Michael Scire authored and SciresM committed 2019-12-07 12:41:28 -08:00
1 parent fbb5730369
commit 535e49a38d
17 files changed
+123 -42

No files matched your search

@@ -182,7 +182,11 @@ namespace sts::pm::impl {
};
/* Process Tracking globals. */
os::Thread g_process_track_thread;
void ProcessTrackingMain(void *arg);
constexpr size_t ProcessTrackThreadStackSize = 0x4000;
constexpr int ProcessTrackThreadPriority = 0x15;
os::StaticThread<ProcessTrackThreadStackSize> g_process_track_thread(&ProcessTrackingMain, nullptr, ProcessTrackThreadPriority);
/* Process lists. */
ProcessList g_process_list;
@@ -468,8 +472,6 @@ namespace sts::pm::impl {
R_TRY(resource::InitializeResourceManager());
/* Start thread. */
/* TODO: Allocate thread stack resources statically, will require PR to libnx. */
R_ASSERT(g_process_track_thread.Initialize(&ProcessTrackingMain, nullptr, 0x4000, 0x15));
R_ASSERT(g_process_track_thread.Start());
return ResultSuccess;
+2 -3
View File
@@ -36,10 +36,9 @@ extern "C" {
u32 __nx_applet_type = AppletType_None;
u32 __nx_fs_num_sessions = 1;
u32 __nx_fsdev_direntry_cache_size = 1;
/* TODO: Statically allocate PM resource thread stack, reduce this. */
/* TODO: Determine what the minimum consistent value for this is (dump heap at runtime). */
#define INNER_HEAP_SIZE 0xC000
#define INNER_HEAP_SIZE 0x4000
size_t nx_inner_heap_size = INNER_HEAP_SIZE;
char nx_inner_heap[INNER_HEAP_SIZE];