本文整理汇总了C++中PyObject_GC_Del函数的典型用法代码示例。如果您正苦于以下问题:C++ PyObject_GC_Del函数的具体用法?C++ PyObject_GC_Del怎么用?C++ PyObject_GC_Del使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PyObject_GC_Del函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: __Pyx_Generator_dealloc
static void
__Pyx_Generator_dealloc(PyObject *self)
{
__pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
PyObject_GC_UnTrack(gen);
if (gen->gi_weakreflist != NULL)
PyObject_ClearWeakRefs(self);
PyObject_GC_Track(self);
if (gen->resume_label > 0) {
/* Generator is paused, so we need to close */
Py_TYPE(gen)->tp_del(self);
if (self->ob_refcnt > 0)
return; /* resurrected. :( */
}
PyObject_GC_UnTrack(self);
Py_CLEAR(gen->closure);
Py_CLEAR(gen->classobj);
Py_CLEAR(gen->exc_type);
Py_CLEAR(gen->exc_value);
Py_CLEAR(gen->exc_traceback);
PyObject_GC_Del(gen);
}
开发者ID:vietlq,项目名称:cython,代码行数:25,代码来源:Generator.c
示例2: weakref_dealloc
static void
weakref_dealloc(PyWeakReference *self)
{
PyObject_GC_UnTrack((PyObject *)self);
clear_weakref(self);
PyObject_GC_Del(self);
}
开发者ID:MatiasNAmendola,项目名称:cleese,代码行数:7,代码来源:weakrefobject.c
示例3: __Pyx_Generator_dealloc
static void __Pyx_Generator_dealloc(PyObject *self) {
__pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
PyObject_GC_UnTrack(gen);
if (gen->gi_weakreflist != NULL)
PyObject_ClearWeakRefs(self);
if (gen->resume_label > 0) {
// Generator is paused, so we need to close
PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1
if (PyObject_CallFinalizerFromDealloc(self))
#else
Py_TYPE(gen)->tp_del(self);
if (self->ob_refcnt > 0)
#endif
{
// resurrected. :(
return;
}
PyObject_GC_UnTrack(self);
}
__Pyx_Generator_clear(self);
PyObject_GC_Del(gen);
}
开发者ID:Aeternam,项目名称:server_status,代码行数:26,代码来源:Generator.c
示例4: cell_dealloc
static void
cell_dealloc(PyCellObject *op)
{
_PyObject_GC_UNTRACK(op);
Py_XDECREF(op->ob_ref);
PyObject_GC_Del(op);
}
开发者ID:LinkedModernismProject,项目名称:web_code,代码行数:7,代码来源:cellobject.c
示例5: crypto_PKCS12_dealloc
/*
* Deallocate the memory used by the PKCS12 object
*
* Arguments: self - The PKCS12 object
* Returns: None
*/
static void
crypto_PKCS12_dealloc(crypto_PKCS12Obj *self)
{
PyObject_GC_UnTrack(self);
crypto_PKCS12_clear(self);
PyObject_GC_Del(self);
}
开发者ID:15580056814,项目名称:hue,代码行数:13,代码来源:pkcs12.c
示例6: _Node_Del
void _Node_Del(NodeObject *node)
{
PyObject_GC_UnTrack(node);
Py_CLEAR(node->parent);
PyObject_GC_Del((PyObject *) node);
}
开发者ID:abed-hawa,项目名称:amara,代码行数:7,代码来源:node.c
示例7: iter_dealloc
static void
iter_dealloc(seqiterobject *it)
{
_PyObject_GC_UNTRACK(it);
Py_XDECREF(it->it_seq);
PyObject_GC_Del(it);
}
开发者ID:AndyPanda95,项目名称:python-for-android,代码行数:7,代码来源:iterobject.c
示例8: code_dealloc
static void
code_dealloc(PyCodeObject *co)
{
if (co->co_extra != NULL) {
PyInterpreterState *interp = PyThreadState_Get()->interp;
_PyCodeObjectExtra *co_extra = co->co_extra;
for (Py_ssize_t i = 0; i < co_extra->ce_size; i++) {
freefunc free_extra = interp->co_extra_freefuncs[i];
if (free_extra != NULL) {
free_extra(co_extra->ce_extras[i]);
}
}
PyMem_Free(co_extra);
}
Py_XDECREF(co->co_code);
Py_XDECREF(co->co_consts);
Py_XDECREF(co->co_names);
Py_XDECREF(co->co_varnames);
Py_XDECREF(co->co_freevars);
Py_XDECREF(co->co_cellvars);
Py_XDECREF(co->co_filename);
Py_XDECREF(co->co_name);
Py_XDECREF(co->co_lnotab);
if (co->co_cell2arg != NULL)
PyMem_FREE(co->co_cell2arg);
if (co->co_zombieframe != NULL)
PyObject_GC_Del(co->co_zombieframe);
if (co->co_weakreflist != NULL)
PyObject_ClearWeakRefs((PyObject*)co);
PyObject_DEL(co);
}
开发者ID:Apoorvadabhere,项目名称:cpython,代码行数:35,代码来源:codeobject.c
示例9: record_iter_dealloc
static void
record_iter_dealloc(ApgRecordIterObject *it)
{
_PyObject_GC_UNTRACK(it);
Py_CLEAR(it->it_seq);
PyObject_GC_Del(it);
}
开发者ID:datnamer,项目名称:asyncpg,代码行数:7,代码来源:recordobj.c
示例10: PyJudyIntSetIter_dealloc
static void PyJudyIntSetIter_dealloc(PyJudyIntSetIter* self)
{
PyObject_GC_UnTrack(self);
Py_XDECREF(self->s);
self->s = 0;
PyObject_GC_Del(self);
}
开发者ID:dohop,项目名称:py-judy,代码行数:7,代码来源:judy_int_set.c
示例11: proxy_dealloc
static void
proxy_dealloc(proxyobject *pp)
{
_PyObject_GC_UNTRACK(pp);
Py_DECREF(pp->dict);
PyObject_GC_Del(pp);
}
开发者ID:develersrl,项目名称:dspython,代码行数:7,代码来源:descrobject.c
示例12: coro_wrapper_dealloc
static void
coro_wrapper_dealloc(PyCoroWrapper *cw)
{
_PyObject_GC_UNTRACK((PyObject *)cw);
Py_CLEAR(cw->cw_coroutine);
PyObject_GC_Del(cw);
}
开发者ID:DinoV,项目名称:gilectomy,代码行数:7,代码来源:genobject.c
示例13: pair_dealloc
static void pair_dealloc(PyObject *self) {
// checked
PyObject_GC_UnTrack(self);
Py_TRASHCAN_SAFE_BEGIN(self);
Py_CLEAR(SibPair_CAR(self));
Py_CLEAR(SibPair_CDR(self));
Py_CLEAR(((SibPair *) self)->position);
if (pair_free_count < PAIR_MAX_FREE) {
SibPair_CDR(self) = (PyObject *) pair_free_list;
pair_free_list = (SibPair *) self;
pair_free_count++;
// printf("saving SibPair for later, count=%i\n", pair_free_count);
} else {
// printf("plenty of SibPair, not recycling\n");
// Py_TYPE(self)->tp_free(self);
PyObject_GC_Del(self);
}
Py_TRASHCAN_SAFE_END(self);
}
开发者ID:obriencj,项目名称:python-sibilant,代码行数:27,代码来源:pair.c
示例14: Repository_dealloc
void
Repository_dealloc(Repository *self)
{
PyObject_GC_UnTrack(self);
Py_XDECREF(self->index);
git_repository_free(self->repo);
PyObject_GC_Del(self);
}
开发者ID:cboos,项目名称:pygit2,代码行数:8,代码来源:repository.c
示例15: PySlice_Fini
void PySlice_Fini(void)
{
PySliceObject *obj = slice_cache;
if (obj != NULL) {
slice_cache = NULL;
PyObject_GC_Del(obj);
}
}
开发者ID:adrian17,项目名称:cpython,代码行数:8,代码来源:sliceobject.c
示例16: descr_dealloc
static void
descr_dealloc(PyDescrObject *descr)
{
_PyObject_GC_UNTRACK(descr);
Py_XDECREF(descr->d_type);
Py_XDECREF(descr->d_name);
PyObject_GC_Del(descr);
}
开发者ID:develersrl,项目名称:dspython,代码行数:8,代码来源:descrobject.c
示例17: Config_dealloc
void
Config_dealloc(Config *self)
{
PyObject_GC_UnTrack(self);
Py_XDECREF(self->repo);
git_config_free(self->config);
PyObject_GC_Del(self);
}
开发者ID:cboos,项目名称:pygit2,代码行数:8,代码来源:config.c
示例18: skipdictiter_dealloc
static void
skipdictiter_dealloc(SkipDictIterObject *it)
{
PyObject_GC_UnTrack(it);
slIterDel(it->iter);
Py_XDECREF(it->skipdict);
PyObject_GC_Del(it);
}
开发者ID:malthe,项目名称:skipdict,代码行数:8,代码来源:skipdict.c
示例19: proxy_dealloc
static void
proxy_dealloc(PyWeakReference *self)
{
if (self->wr_callback != NULL)
PyObject_GC_UnTrack((PyObject *)self);
clear_weakref(self);
PyObject_GC_Del(self);
}
开发者ID:BackupTheBerlios,项目名称:pyasynchio-svn,代码行数:8,代码来源:weakrefobject.c
示例20: calliter_dealloc
static void
calliter_dealloc(calliterobject *it)
{
_PyObject_GC_UNTRACK(it);
Py_XDECREF(it->it_callable);
Py_XDECREF(it->it_sentinel);
PyObject_GC_Del(it);
}
开发者ID:AndyPanda95,项目名称:python-for-android,代码行数:8,代码来源:iterobject.c
注:本文中的PyObject_GC_Del函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论