AmendHub

Download:

jcs

/

subtext

/

amendments

/

241

main: Log memory zone, stack, and heap sizes at startup


jcs made amendment 241 over 2 years ago
--- main.c Sat Jul 30 22:37:11 2022 +++ main.c Thu Aug 11 16:44:44 2022 @@ -52,6 +52,7 @@ main(void) GrafPtr old_port; AppFile finder_file; struct focusable *found_focusable; + unsigned long zone_size, stack_size, heap_size; short event_in, n, finder_action, finder_count; char key; @@ -100,9 +101,17 @@ main(void) session_load_tally(); logger = logger_init(); + logger_update_title(); + + zone_size = (unsigned long)CurStackBase - (unsigned long)ApplZone; + stack_size = (unsigned long)CurStackBase - (unsigned long)ApplLimit; + heap_size = (unsigned long)ApplLimit - (unsigned long)ApplZone; + logger_printf(logger, "Initialized with %ldKB zone, %ldKB stack for " + "%d threads, %ldKB heap", zone_size / 1024L, stack_size / 1024L, + NUM_UTHREADS, heap_size / 1024L); + logger_printf(logger, "[db] Updating username cache"); user_cache_usernames(); - logger_update_title(); if (db->config.telnet_port) telnet_init();