[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[398] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-11-17 14:55:23
|
Revision: 398 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=398&view=rev Author: nickols_k Date: 2012-11-17 14:55:17 +0000 (Sat, 17 Nov 2012) Log Message: ----------- add test for backtrace efficiency Modified Paths: -------------- mplayerxp/mplayerxp.cpp mplayerxp/osdep/mplib.h Modified: mplayerxp/mplayerxp.cpp =================================================================== --- mplayerxp/mplayerxp.cpp 2012-11-17 14:33:48 UTC (rev 397) +++ mplayerxp/mplayerxp.cpp 2012-11-17 14:55:17 UTC (rev 398) @@ -207,6 +207,12 @@ return MPXP_Virus; } +static volatile void __attribute__ ((noinline)) mpxp_test_backtrace(void) { + any_t* caller = get_caller_address(); + goto *caller; + kill(getpid(), SIGILL); +} + unsigned xp_num_cpu; static unsigned get_number_cpu(void) { #ifdef _OPENMP @@ -1679,6 +1685,7 @@ \******************************************/ int MPlayerXP(int argc,char* argv[], char *envp[]){ mpxp_init_antiviral_protection(1); + mpxp_test_backtrace(); int i; stream_t* stream=NULL; int stream_dump_type=0; Modified: mplayerxp/osdep/mplib.h =================================================================== --- mplayerxp/osdep/mplib.h 2012-11-17 14:33:48 UTC (rev 397) +++ mplayerxp/osdep/mplib.h 2012-11-17 14:55:17 UTC (rev 398) @@ -75,6 +75,12 @@ print_backtrace(why,stack,ncalls); } +static inline any_t* get_caller_address(void) { + any_t* stack[2]; + unsigned ncalls; + ncalls=backtrace(stack,2); + return stack[1]; +} extern any_t* __FASTCALL__ SECURE_NAME0(_mp_malloc)(size_t size); extern any_t* __FASTCALL__ SECURE_NAME1(_mp_mallocz)(size_t size); extern void __FASTCALL__ SECURE_NAME2(_mp_free)(any_t* ptr); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |