mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-03 18:22:25 -06:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
	
		
			243 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
	
		
			243 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package memlimit
 | 
						|
 | 
						|
import (
 | 
						|
	"github.com/pbnjay/memory"
 | 
						|
)
 | 
						|
 | 
						|
// FromSystem returns the total memory of the system.
 | 
						|
func FromSystem() (uint64, error) {
 | 
						|
	limit := memory.TotalMemory()
 | 
						|
	if limit == 0 {
 | 
						|
		return 0, ErrNoLimit
 | 
						|
	}
 | 
						|
	return limit, nil
 | 
						|
}
 |