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
e1f645a6
Commit
e1f645a6
authored
Mar 28, 2002
by
Neil Schemenauer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add _Py_AS_GC macro. It will be used by the trashcan code on object.c.
parent
377ae5aa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Include/objimpl.h
Include/objimpl.h
+4
-2
No files found.
Include/objimpl.h
View file @
e1f645a6
...
...
@@ -235,10 +235,12 @@ typedef union _gc_head {
extern
PyGC_Head
_PyGC_generation0
;
#define _Py_AS_GC(o) ((PyGC_Head *)(o)-1)
/* Tell the GC to track this object. NB: While the object is tracked the
* collector it must be safe to call the ob_traverse method. */
#define _PyObject_GC_TRACK(o) do { \
PyGC_Head *g =
(PyGC_Head *)(o)-1
; \
PyGC_Head *g =
_Py_AS_GC(o)
; \
if (g->gc.gc_next != NULL) \
Py_FatalError("GC object already in linked list"); \
g->gc.gc_next = &_PyGC_generation0; \
...
...
@@ -249,7 +251,7 @@ extern PyGC_Head _PyGC_generation0;
/* Tell the GC to stop tracking this object. */
#define _PyObject_GC_UNTRACK(o) do { \
PyGC_Head *g =
(PyGC_Head *)(o)-1
; \
PyGC_Head *g =
_Py_AS_GC(o)
; \
g->gc.gc_prev->gc.gc_next = g->gc.gc_next; \
g->gc.gc_next->gc.gc_prev = g->gc.gc_prev; \
g->gc.gc_next = 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