|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2009-05-17 19:22 UTC] s dot spasov at gmail dot com
 Description: ------------ Error compiling XHProf under Leopard 10.5.7 because of lack of Apple's Affinity API: http://developer.apple.com/releasenotes/Performance/RN- AffinityAPI/ /Users/svilen/Build/php-5.2.9/ext/xhprof/xhprof.c:202: error: syntax error before 'cpu_set_t' /Users/svilen/Build/php-5.2.9/ext/xhprof/xhprof.c:202: warning: no semicolon at end of struct or union /Users/svilen/Build/php-5.2.9/ext/xhprof/xhprof.c:213: error: syntax error before '}' token /Users/svilen/Build/php-5.2.9/ext/xhprof/xhprof.c:213: warning: data definition has no type or storage class /Users/svilen/Build/php-5.2.9/ext/xhprof/xhprof.c:222: error: syntax error before 'hp_globals' /Users/svilen/Build/php-5.2.9/ext/xhprof/xhprof.c:222: warning: data definition has no type or storage class Reproduce code: --------------- Suggest patch: http://www.svilen.com/xhprof_0.9.1_patch_build_macosx_leopard.diff PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 18:00:01 2025 UTC | 
I have one final question about your patch. Why this ifndef around this block of code? #ifndef __APPLE__ if (GET_AFFINITY(0, sizeof(cpu_set_t), &hp_globals.prev_mask) < 0) { perror("getaffinity"); return FAILURE; } #endif While profiling we get current affinity mask into "prev_mask". During profiling the process is bound to a CPU. At the end, we then restore the prev_mask back (in restore_cpu_affinity() called from hp_stop()). By commenting out the above, I am concerned that "prev_mask" is now in some uninitialized state, and this uninitialized value will then get used in restore_cpu_affinity().