~ubuntu-branches/ubuntu/saucy/python2.7/saucy-proposed

« back to all changes in this revision

Viewing changes to Include/object.h

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-05-15 19:15:16 UTC
  • mto: (36.1.23 sid)
  • mto: This revision was merged to the branch mainline in revision 87.
  • Revision ID: package-import@ubuntu.com-20130515191516-zmv6to904wemey7s
Tags: upstream-2.7.5
ImportĀ upstreamĀ versionĀ 2.7.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
984
984
 
985
985
#define PyTrash_UNWIND_LEVEL 50
986
986
 
 
987
/* Note the workaround for when the thread state is NULL (issue #17703) */
987
988
#define Py_TRASHCAN_SAFE_BEGIN(op) \
988
989
    do { \
989
990
        PyThreadState *_tstate = PyThreadState_GET(); \
990
 
        if (_tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \
991
 
            ++_tstate->trash_delete_nesting;
 
991
        if (!_tstate || \
 
992
            _tstate->trash_delete_nesting < PyTrash_UNWIND_LEVEL) { \
 
993
            if (_tstate) \
 
994
                ++_tstate->trash_delete_nesting;
992
995
            /* The body of the deallocator is here. */
993
996
#define Py_TRASHCAN_SAFE_END(op) \
994
 
            --_tstate->trash_delete_nesting; \
995
 
            if (_tstate->trash_delete_later && _tstate->trash_delete_nesting <= 0) \
996
 
                _PyTrash_thread_destroy_chain(); \
 
997
            if (_tstate) { \
 
998
                --_tstate->trash_delete_nesting; \
 
999
                if (_tstate->trash_delete_later \
 
1000
                    && _tstate->trash_delete_nesting <= 0) \
 
1001
                    _PyTrash_thread_destroy_chain(); \
 
1002
            } \
997
1003
        } \
998
1004
        else \
999
1005
            _PyTrash_thread_deposit_object((PyObject*)op); \