Author vstinner
Recipients njs, vstinner
Date 2016-03-10.14:34:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457620460.66.0.621418422799.issue26530@psf.upfronthosting.co.za>
In-reply-to
Content
Patch without test.

I chose to require the GIL to be held for efficiency. IMHO the common case is more than the GIL is held.

Example to call the function if the GIL is not held:

    int res;
    PyGILState_STATE gil_state;
    gil_state = PyGILState_Ensure();
    res = _PyTraceMalloc_Track(ptr, size);
    PyGILState_Release(gil_state);
    return res;

See also my numpy pull request on PyMem_Malloc() called without the GIL being held:
https://github.com/numpy/numpy/pull/7404
History
Date User Action Args
2016-03-10 14:34:20vstinnersetrecipients: + vstinner, njs
2016-03-10 14:34:20vstinnersetmessageid: <1457620460.66.0.621418422799.issue26530@psf.upfronthosting.co.za>
2016-03-10 14:34:20vstinnerlinkissue26530 messages
2016-03-10 14:34:20vstinnercreate