mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and Py_REFCNT. Macros for b/w compatibility are available.
This commit is contained in:
		
							parent
							
								
									d586559c31
								
							
						
					
					
						commit
						e93237dfcc
					
				
					 108 changed files with 916 additions and 908 deletions
				
			
		| 
						 | 
				
			
			@ -154,9 +154,9 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
 | 
			
		|||
/* Macros trading binary compatibility for speed. See also pymem.h.
 | 
			
		||||
   Note that these macros expect non-NULL object pointers.*/
 | 
			
		||||
#define PyObject_INIT(op, typeobj) \
 | 
			
		||||
	( Py_Type(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
 | 
			
		||||
	( Py_TYPE(op) = (typeobj), _Py_NewReference((PyObject *)(op)), (op) )
 | 
			
		||||
#define PyObject_INIT_VAR(op, typeobj, size) \
 | 
			
		||||
	( Py_Size(op) = (size), PyObject_INIT((op), (typeobj)) )
 | 
			
		||||
	( Py_SIZE(op) = (size), PyObject_INIT((op), (typeobj)) )
 | 
			
		||||
 | 
			
		||||
#define _PyObject_SIZE(typeobj) ( (typeobj)->tp_basicsize )
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -231,8 +231,8 @@ PyAPI_FUNC(Py_ssize_t) PyGC_Collect(void);
 | 
			
		|||
#define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
 | 
			
		||||
 | 
			
		||||
/* Test if an object has a GC head */
 | 
			
		||||
#define PyObject_IS_GC(o) (PyType_IS_GC(Py_Type(o)) && \
 | 
			
		||||
	(Py_Type(o)->tp_is_gc == NULL || Py_Type(o)->tp_is_gc(o)))
 | 
			
		||||
#define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \
 | 
			
		||||
	(Py_TYPE(o)->tp_is_gc == NULL || Py_TYPE(o)->tp_is_gc(o)))
 | 
			
		||||
 | 
			
		||||
PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
 | 
			
		||||
#define PyObject_GC_Resize(type, op, n) \
 | 
			
		||||
| 
						 | 
				
			
			@ -328,7 +328,7 @@ PyAPI_FUNC(void) PyObject_GC_Del(void *);
 | 
			
		|||
         && ((t)->tp_weaklistoffset > 0))
 | 
			
		||||
 | 
			
		||||
#define PyObject_GET_WEAKREFS_LISTPTR(o) \
 | 
			
		||||
	((PyObject **) (((char *) (o)) + Py_Type(o)->tp_weaklistoffset))
 | 
			
		||||
	((PyObject **) (((char *) (o)) + Py_TYPE(o)->tp_weaklistoffset))
 | 
			
		||||
 | 
			
		||||
#ifdef __cplusplus
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue