mirror of
https://github.com/autc04/Retro68.git
synced 2024-06-14 15:29:56 +00:00
LaunchAPPLServer: Think about memory usage and code size
This commit is contained in:
parent
2474387f74
commit
1871a9cbad
|
@ -10,3 +10,7 @@ target_include_directories(LaunchAPPLCommon PUBLIC .)
|
|||
|
||||
add_executable(TestLaunchAPPLCommon Test.cc)
|
||||
target_link_libraries(TestLaunchAPPLCommon LaunchAPPLCommon)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME MATCHES Retro68)
|
||||
#target_compile_options(LaunchAPPLCommon PRIVATE -ffunction-sections -fno-exceptions -Os)
|
||||
endif()
|
||||
|
|
|
@ -9,5 +9,14 @@ add_application(LaunchAPPLServer
|
|||
target_link_libraries(LaunchAPPLServer LaunchAPPLCommon)
|
||||
set_target_properties(LaunchAPPLServer PROPERTIES
|
||||
CXX_STANDARD 17
|
||||
LINK_FLAGS "-Wl,-gc-sections"
|
||||
)
|
||||
target_compile_options(LaunchAPPLServer PRIVATE -ffunction-sections -fno-exceptions -Os)
|
||||
if(CMAKE_SYSTEM_NAME MATCHES Retro68)
|
||||
set_target_properties(LaunchAPPLServer PROPERTIES
|
||||
LINK_FLAGS "-Wl,-gc-sections -Wl,--mac-segments -Wl,${CMAKE_CURRENT_SOURCE_DIR}/LaunchAPPLServer.segmap"
|
||||
)
|
||||
else()
|
||||
set_target_properties(LaunchAPPLServer PROPERTIES
|
||||
LINK_FLAGS "-Wl,-gc-sections"
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -218,6 +218,13 @@ void DoUpdate(WindowRef w)
|
|||
PaintRect(&r);
|
||||
}
|
||||
|
||||
Str255 str;
|
||||
NumToString(FreeMem(), str);
|
||||
MoveTo(10,80);
|
||||
DrawString(str); DrawString("\p / ");
|
||||
NumToString(ApplicationZone()->bkLim - (Ptr)ApplicationZone(), str);
|
||||
DrawString(str); DrawString("\p bytes free");
|
||||
|
||||
EndUpdate(w);
|
||||
}
|
||||
|
||||
|
@ -379,6 +386,12 @@ void WritePrefs()
|
|||
|
||||
int main()
|
||||
{
|
||||
// default stack size is 8KB on B&W macs
|
||||
// and 24 KB on Color macs.
|
||||
// 8KB seems to be not quite enough,
|
||||
// so increase stack size by 8KB.
|
||||
SetApplLimit(GetApplLimit() - 8192);
|
||||
MaxApplZone();
|
||||
#if !TARGET_API_MAC_CARBON
|
||||
InitGraf(&qd.thePort);
|
||||
InitFonts();
|
||||
|
@ -387,7 +400,7 @@ int main()
|
|||
TEInit();
|
||||
InitDialogs(NULL);
|
||||
#endif
|
||||
|
||||
|
||||
SetMenuBar(GetNewMBar(128));
|
||||
AppendResMenu(GetMenu(128), 'DRVR');
|
||||
DrawMenuBar();
|
||||
|
|
|
@ -123,6 +123,6 @@ resource 'SIZE' (-1) {
|
|||
reserved,
|
||||
reserved,
|
||||
reserved,
|
||||
256 * 1024,
|
||||
256 * 1024
|
||||
136 * 1024,
|
||||
136 * 1024
|
||||
};
|
||||
|
|
9
LaunchAPPL/Server/LaunchAPPLServer.segmap
Normal file
9
LaunchAPPL/Server/LaunchAPPLServer.segmap
Normal file
|
@ -0,0 +1,9 @@
|
|||
SEGMENT Serial
|
||||
*/libLaunchAPPLCommon.a:ReliableStream.*
|
||||
*/MacSerialStream.*
|
||||
|
||||
SEGMENT Launcher
|
||||
*/AppLauncher.*
|
||||
|
||||
SEGMENT libstdc++
|
||||
*/libstdc++.a:*
|
Loading…
Reference in New Issue
Block a user