mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
WIP: musl port
This commit is contained in:
@@ -697,12 +697,14 @@ static bool CreateTempFilename( TempFilename_t &info, const char *filenameBase,
|
||||
if ( info.fh.file )
|
||||
return true;
|
||||
}
|
||||
#if HAVE_ZLIB
|
||||
else
|
||||
{
|
||||
info.fh.gzfile = gzopen( info.Filename, "wb6" );
|
||||
if ( info.fh.gzfile )
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -1578,7 +1578,7 @@ CON_COMMAND( star_memory, "Dump memory stats" )
|
||||
{
|
||||
// get a current stat of available memory
|
||||
// 32 MB is reserved and fixed by OS, so not reporting to allow memory loggers sync
|
||||
#ifdef LINUX
|
||||
#if defined( PLATFORM_GLIBC )
|
||||
struct mallinfo memstats = mallinfo( );
|
||||
Msg( "sbrk size: %.2f MB, Used: %.2f MB, #mallocs = %d\n",
|
||||
memstats.arena / ( 1024.0 * 1024.0), memstats.uordblks / ( 1024.0 * 1024.0 ), memstats.hblks );
|
||||
@@ -1586,14 +1586,14 @@ CON_COMMAND( star_memory, "Dump memory stats" )
|
||||
struct mstats memstats = mstats( );
|
||||
Msg( "Available %.2f MB, Used: %.2f MB, #mallocs = %lu\n",
|
||||
memstats.bytes_free / ( 1024.0 * 1024.0), memstats.bytes_used / ( 1024.0 * 1024.0 ), memstats.chunks_used );
|
||||
#elif PLATFORM_BSD
|
||||
# warning TODO: Implement memory stats (peace of sheet of course)
|
||||
#else // Win32
|
||||
#elif defined( _WIN32 ) // Win32
|
||||
MEMORYSTATUS stat;
|
||||
GlobalMemoryStatus( &stat );
|
||||
Msg( "Available: %.2f MB, Used: %.2f MB, Free: %.2f MB\n",
|
||||
stat.dwTotalPhys/( 1024.0f*1024.0f ) - 32.0f,
|
||||
( stat.dwTotalPhys - stat.dwAvailPhys )/( 1024.0f*1024.0f ) - 32.0f,
|
||||
stat.dwAvailPhys/( 1024.0f*1024.0f ) );
|
||||
#else
|
||||
#warning TODO: Implement memory stats
|
||||
#endif
|
||||
}
|
||||
|
||||
+1
-5
@@ -279,10 +279,6 @@ static void posix_signal_handler( int i )
|
||||
#define DO_TRY if ( sigsetjmp( g_mark, 1 ) == 0 )
|
||||
#define DO_CATCH else
|
||||
|
||||
#if defined( OSX ) || defined(PLATFORM_BSD)
|
||||
#define __sighandler_t sig_t
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define DO_TRY try
|
||||
@@ -390,7 +386,7 @@ public:
|
||||
_se_translator_function curfilter = _set_se_translator( &FailSafe );
|
||||
#elif defined( POSIX )
|
||||
// Only need to worry about this function crashing when we're dealing with a real crash.
|
||||
__sighandler_t curfilter = bRealCrash ? signal( SIGSEGV, posix_signal_handler ) : 0;
|
||||
sig_t curfilter = bRealCrash ? signal( SIGSEGV, posix_signal_handler ) : 0;
|
||||
#endif
|
||||
|
||||
DO_TRY
|
||||
|
||||
Reference in New Issue
Block a user