mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-03 23:02:24 -06:00 
			
		
		
		
	
		
			
	
	
		
			13 lines
		
	
	
	
		
			273 B
		
	
	
	
		
			Go
		
	
	
	
	
	
		
		
			
		
	
	
			13 lines
		
	
	
	
		
			273 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| 
								 | 
							
								//go:build libc.memexpvar
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								package libc
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								import "expvar"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								func init() {
							 | 
						||
| 
								 | 
							
									// make sure to build with -tags=memory.counters to have the actual data accumulated in memory allocator
							 | 
						||
| 
								 | 
							
									expvar.Publish("memory.allocator", expvar.Func(func() interface{} {
							 | 
						||
| 
								 | 
							
										return MemStat()
							 | 
						||
| 
								 | 
							
									}))
							 | 
						||
| 
								 | 
							
								}
							 |