[Python-checkins] CVS: python/dist/src/Include objimpl.h,2.44,2.45

Neil Schemenauer nascheme@users.sourceforge.net
Mon, 18 Mar 2002 10:12:37 -0800


Update of /cvsroot/python/python/dist/src/Include
In directory usw-pr-cvs1:/tmp/cvs-serv3488/Include

Modified Files:
	objimpl.h 
Log Message:
Simpilify PyCore_* macros by assuming the function prototypes for
malloc() and free() don't change.


Index: objimpl.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/objimpl.h,v
retrieving revision 2.44
retrieving revision 2.45
diff -C2 -d -r2.44 -r2.45
*** objimpl.h	28 Feb 2002 19:38:51 -0000	2.44
--- objimpl.h	18 Mar 2002 18:12:35 -0000	2.45
***************
*** 78,115 ****
  
  #ifdef WITH_PYMALLOC
! #define PyCore_OBJECT_MALLOC_FUNC    _PyCore_ObjectMalloc
! #define PyCore_OBJECT_REALLOC_FUNC   _PyCore_ObjectRealloc
! #define PyCore_OBJECT_FREE_FUNC      _PyCore_ObjectFree
! #define NEED_TO_DECLARE_OBJECT_MALLOC_AND_FRIEND
  #endif /* !WITH_PYMALLOC */
  
- #ifndef PyCore_OBJECT_MALLOC_FUNC
- #undef PyCore_OBJECT_REALLOC_FUNC
- #undef PyCore_OBJECT_FREE_FUNC
- #define PyCore_OBJECT_MALLOC_FUNC    PyCore_MALLOC_FUNC
- #define PyCore_OBJECT_REALLOC_FUNC   PyCore_REALLOC_FUNC
- #define PyCore_OBJECT_FREE_FUNC      PyCore_FREE_FUNC
- #endif
- 
- #ifndef PyCore_OBJECT_MALLOC_PROTO
- #undef PyCore_OBJECT_REALLOC_PROTO
- #undef PyCore_OBJECT_FREE_PROTO
- #define PyCore_OBJECT_MALLOC_PROTO   PyCore_MALLOC_PROTO
- #define PyCore_OBJECT_REALLOC_PROTO  PyCore_REALLOC_PROTO
- #define PyCore_OBJECT_FREE_PROTO     PyCore_FREE_PROTO
- #endif
- 
- #ifdef NEED_TO_DECLARE_OBJECT_MALLOC_AND_FRIEND
- extern void *PyCore_OBJECT_MALLOC_FUNC PyCore_OBJECT_MALLOC_PROTO;
- extern void *PyCore_OBJECT_REALLOC_FUNC PyCore_OBJECT_REALLOC_PROTO;
- extern void PyCore_OBJECT_FREE_FUNC PyCore_OBJECT_FREE_PROTO;
- #endif
- 
  #ifndef PyCore_OBJECT_MALLOC
  #undef PyCore_OBJECT_REALLOC
  #undef PyCore_OBJECT_FREE
! #define PyCore_OBJECT_MALLOC(n)      PyCore_OBJECT_MALLOC_FUNC(n)
! #define PyCore_OBJECT_REALLOC(p, n)  PyCore_OBJECT_REALLOC_FUNC((p), (n))
! #define PyCore_OBJECT_FREE(p)        PyCore_OBJECT_FREE_FUNC(p)
  #endif
  
--- 78,95 ----
  
  #ifdef WITH_PYMALLOC
! void *_PyCore_ObjectMalloc(size_t nbytes);
! void *_PyCore_ObjectRealloc(void *p, size_t nbytes);
! void _PyCore_ObjectFree(void *p);
! #define PyCore_OBJECT_MALLOC    _PyCore_ObjectMalloc
! #define PyCore_OBJECT_REALLOC   _PyCore_ObjectRealloc
! #define PyCore_OBJECT_FREE      _PyCore_ObjectFree
  #endif /* !WITH_PYMALLOC */
  
  #ifndef PyCore_OBJECT_MALLOC
  #undef PyCore_OBJECT_REALLOC
  #undef PyCore_OBJECT_FREE
! #define PyCore_OBJECT_MALLOC(n)     PyCore_MALLOC(n)
! #define PyCore_OBJECT_REALLOC(p, n) PyCore_REALLOC((p), (n))
! #define PyCore_OBJECT_FREE(p)       PyCore_FREE(p)
  #endif