mirror of
				https://github.com/scottdraves/flam3.git
				synced 2025-10-31 01:10:32 -04:00 
			
		
		
		
	support for 64-bit Apple OS in memory check
git-svn-id: https://flam3.googlecode.com/svn/trunk@91 77852712-ef1d-11de-8684-7d64432d61a3
This commit is contained in:
		 Erik Reckase
					Erik Reckase
				
			
				
					committed by
					
						 Scott Draves
						Scott Draves
					
				
			
			
				
	
			
			
			 Scott Draves
						Scott Draves
					
				
			
						parent
						
							ba1a8451bf
						
					
				
				
					commit
					83ecdc6104
				
			| @ -49,13 +49,19 @@ int calc_nstrips(flam3_frame *spec) { | ||||
|   mem_available = | ||||
|       (double)sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE); | ||||
| #elif defined __APPLE__ | ||||
| #ifdef __LP64__ | ||||
| long physmem; | ||||
| size_t len = sizeof(physmem); | ||||
| static int mib[2] = { CTL_HW, HW_MEMSIZE }; | ||||
| #else | ||||
| unsigned int physmem; | ||||
| size_t len = sizeof(physmem); | ||||
| static int mib[2] = { CTL_HW, HW_PHYSMEM }; | ||||
| #endif | ||||
| if (sysctl(mib, 2, &physmem, &len, NULL, 0) == 0 && len == sizeof(physmem)) { | ||||
|    mem_available = (double )physmem; | ||||
| } else { | ||||
|       fprintf(stderr, "warning: unable to determine physical memory.\n"); | ||||
|    fprintf(stderr, "warning: unable to determine physical memory.n"); | ||||
|    mem_available = 2e9; | ||||
| } | ||||
| #else | ||||
|  | ||||
		Reference in New Issue
	
	Block a user