Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
60be1db9
Commit
60be1db9
authored
May 22, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some visual enhancements of debugging ifdefs.
Added PyNumber_Coerce decl.
parent
05788519
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
Include/object.h
Include/object.h
+11
-5
No files found.
Include/object.h
View file @
60be1db9
...
...
@@ -97,12 +97,12 @@ whose size is determined when the object is allocated.
int ob_refcnt; \
struct _typeobject *ob_type;
#define PyObject_HEAD_INIT(type) 0, 0, 1, type,
#else
#else
/* !Py_TRACE_REFS */
#define PyObject_HEAD \
int ob_refcnt; \
struct _typeobject *ob_type;
#define PyObject_HEAD_INIT(type) 1, type,
#endif
#endif
/* !Py_TRACE_REFS */
#define PyObject_VAR_HEAD \
PyObject_HEAD \
...
...
@@ -254,6 +254,7 @@ extern int PyObject_SetAttr Py_PROTO((PyObject *, PyObject *, PyObject *));
extern
long
PyObject_Hash
Py_PROTO
((
PyObject
*
));
extern
int
PyObject_IsTrue
Py_PROTO
((
PyObject
*
));
extern
int
PyCallable_Check
Py_PROTO
((
PyObject
*
));
extern
int
PyNumber_Coerce
Py_PROTO
((
PyObject
**
,
PyObject
**
));
/* Flag bits for printing: */
#define Py_PRINT_RAW 1
/* No string quotes etc. */
...
...
@@ -308,33 +309,38 @@ extern void inc_count Py_PROTO((PyTypeObject *));
#endif
#ifdef Py_REF_DEBUG
extern
long
_Py_RefTotal
;
#ifndef Py_TRACE_REFS
#ifdef COUNT_ALLOCS
#define _Py_NewReference(op) (inc_count((op)->ob_type), _Py_RefTotal++, (op)->ob_refcnt = 1)
#else
#define _Py_NewReference(op) (_Py_RefTotal++, (op)->ob_refcnt = 1)
#endif
#endif
#endif
/* !Py_TRACE_REFS */
#define Py_INCREF(op) (_Py_RefTotal++, (op)->ob_refcnt++)
#define Py_DECREF(op) \
if (--_Py_RefTotal, --(op)->ob_refcnt != 0) \
; \
else \
_Py_Dealloc(op)
#else
#else
/* !Py_REF_DEBUG */
#ifdef COUNT_ALLOCS
#define _Py_NewReference(op) (inc_count((op)->ob_type), (op)->ob_refcnt = 1)
#else
#define _Py_NewReference(op) ((op)->ob_refcnt = 1)
#endif
#define Py_INCREF(op) ((op)->ob_refcnt++)
#define Py_DECREF(op) \
if (--(op)->ob_refcnt != 0) \
; \
else \
_Py_Dealloc(op)
#endif
#endif
/* !Py_REF_DEBUG */
/* Macros to use in case the object pointer may be NULL: */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment