mirror of
				https://github.com/eclipse/upm.git
				synced 2025-11-04 00:54:21 +03:00 
			
		
		
		
	upm: new upm.i JS interface file with code to call v8 garbage collector
Signed-off-by: Zion Orent <zorent@ics.com> Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
		
				
					committed by
					
						
						Mihai Tudor Panu
					
				
			
			
				
	
			
			
			
						parent
						
							b25cecd315
						
					
				
				
					commit
					73be07df74
				
			
							
								
								
									
										19
									
								
								src/upm.i
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								src/upm.i
									
									
									
									
									
								
							@@ -2,3 +2,22 @@
 | 
			
		||||
%include "stdint.i"
 | 
			
		||||
 | 
			
		||||
%typemap(out) mraa_result_t = int;
 | 
			
		||||
 | 
			
		||||
#if (SWIG_JAVASCRIPT_V8)
 | 
			
		||||
%{
 | 
			
		||||
	// Because there's no guarantee that v8 will ever call garbage collection,
 | 
			
		||||
	// we're adding a function that will allow a user to call it manually
 | 
			
		||||
	void cleanUp()
 | 
			
		||||
	{
 | 
			
		||||
		// Call the v8 garbage collector as long as there is memory to clean up
 | 
			
		||||
		// See https://codereview.chromium.org/412163003 for this API change
 | 
			
		||||
#if (SWIG_V8_VERSION < 0x032838)
 | 
			
		||||
		while (!v8::V8::IdleNotification())
 | 
			
		||||
#else
 | 
			
		||||
		while (!v8::Isolate::GetCurrent()->IdleNotification(1000))
 | 
			
		||||
#endif
 | 
			
		||||
		{;}
 | 
			
		||||
	}
 | 
			
		||||
%}
 | 
			
		||||
void cleanUp();
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user