mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Use PyObject_* allocator since FutureFeatures is small
This commit is contained in:
		
							parent
							
								
									2c4e4f9839
								
							
						
					
					
						commit
						14bc4e4d89
					
				
					 2 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -314,7 +314,7 @@ compiler_free(struct compiler *c)
 | 
			
		|||
	if (c->c_st)
 | 
			
		||||
		PySymtable_Free(c->c_st);
 | 
			
		||||
	if (c->c_future)
 | 
			
		||||
		PyMem_Free(c->c_future);
 | 
			
		||||
		PyObject_Free(c->c_future);
 | 
			
		||||
	Py_DECREF(c->c_stack);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -120,14 +120,14 @@ PyFuture_FromAST(mod_ty mod, const char *filename)
 | 
			
		|||
{
 | 
			
		||||
	PyFutureFeatures *ff;
 | 
			
		||||
 | 
			
		||||
	ff = (PyFutureFeatures *)PyMem_Malloc(sizeof(PyFutureFeatures));
 | 
			
		||||
	ff = (PyFutureFeatures *)PyObject_Malloc(sizeof(PyFutureFeatures));
 | 
			
		||||
	if (ff == NULL)
 | 
			
		||||
		return NULL;
 | 
			
		||||
	ff->ff_features = 0;
 | 
			
		||||
	ff->ff_lineno = -1;
 | 
			
		||||
 | 
			
		||||
	if (!future_parse(ff, mod, filename)) {
 | 
			
		||||
		PyMem_Free((void *)ff);
 | 
			
		||||
		PyObject_Free(ff);
 | 
			
		||||
		return NULL;
 | 
			
		||||
	}
 | 
			
		||||
	return ff;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue