/* -*- indent-tabs-mode: nil; tab-width: 4; -*- */
/* Format with:
* clang-format -i --style=file src/greenlet/greenlet.c
*
*
* Fix missing braces with:
* clang-tidy src/greenlet/greenlet.c -fix -checks="readability-braces-around-statements"
*/
#include <cstdlib>
#include <string>
#include <algorithm>
#include <exception>
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "structmember.h" // PyMemberDef
#include "greenlet_internal.hpp"
#include "greenlet_refs.hpp"
#include "greenlet_slp_switch.hpp"
#include "greenlet_thread_state.hpp"
#include "greenlet_thread_support.hpp"
#include "greenlet_greenlet.hpp"
using greenlet::ThreadState;
using greenlet::Mutex;
using greenlet::LockGuard;
using greenlet::LockInitError;
using greenlet::PyErrOccurred;
using greenlet::Require;
using greenlet::PyFatalError;
using greenlet::ExceptionState;
using greenlet::StackState;
using greenlet::Greenlet;
// Helpers for reference counting.
// XXX: running the test cases for greenlet 1.1.2 under Python 3.10+pydebug
// with zope.testrunner's "report refcounts" option shows a growth of
// over 500 references when running 90 tests at a steady state (10 repeats)
// Running in verbose mode and adding objgraph to report gives us this
// info in a steady state:
// Ran 90 tests with 0 failures, 0 errors and 1 skipped in 2.120 seconds.
// Showing growth
// tuple 2811 +16
// list 1733 +14
// function 6304 +11
// dict 3604 +9
// cell 707 +9
// greenlet 81 +8
// method 103 +5
// Genlet 40 +4
// list_iterator 30 +3
// getset_descriptor 916 +2
// sum detail refcount=341678 sys refcount=379357 change=523
// Leak details, changes in instances and refcounts by type/class:
// type/class insts refs
// ------------------------------------------------------- ----- ----
// builtins.NoneType 0 2
// builtins.cell 9 20
// builtins.code 0 31
// builtins.dict 18 91
// builtins.frame 20 32
// builtins.function 11 28
// builtins.getset_descriptor 2 2
// builtins.int 2 42
// builtins.list 14 37
// builtins.list_iterator 3 3
// builtins.method 5 5
// builtins.method_descriptor 0 9
// builtins.str 11 76
// builtins.traceback 1 2
// builtins.tuple 20 42
// builtins.type 2 28
// builtins.weakref 2 2
// greenlet.GreenletExit 1 1
// greenlet.greenlet 8 26
// greenlet.tests.test_contextvars.NoContextVarsTests 0 1
// greenlet.tests.test_gc.object_with_finalizer 1 1
// greenlet.tests.test_generator_nested.Genlet 4 26
// greenlet.tests.test_greenlet.convoluted 1 2
// ------------------------------------------------------- ----- ----
// total 135 509
//
// As of the commit that adds this comment, we're doing better than
// 1.1.2, but still not perfect:
// Ran 115 tests with 0 failures, 0 errors, 1 skipped in 8.623 seconds.
// tuple 21310 +23
// dict 5428 +18
// frame 183 +17
// list 1760 +14
// function 6359 +11
// cell 698 +8
// method 105 +5
// int 2709 +4
// TheGenlet 40 +4
// list_iterator 30 +3
// sum detail refcount=345051 sys refcount=383043 change=494
// Leak details, changes in instances and refcounts by type/class:
// type/class insts refs
// ------------------------------------------------------- ----- ----
// builtins.NoneType 0 12
// builtins.bool 0 2
// builtins.cell 8 16
// builtins.code 0 28
// builtins.dict 18 74
// builtins.frame 17 28
// builtins.function 11 28
// builtins.getset_descriptor 2 2
// builtins.int 4 44
// builtins.list 14 39
// builtins.list_iterator 3 3
// builtins.method 5 5
// builtins.method_descriptor 0 8
// builtins.str -2 69
// builtins.tuple 23 42
// builtins.type 2 28
// builtins.weakref 2 2
// greenlet.greenlet 1 1
// greenlet.main_greenlet 1 16
// greenlet.tests.test_contextvars.NoContextVarsTests 0 1
// greenlet.tests.test_gc.object_with_finalizer 1 1
// greenlet.tests.test_generator_nested.TheGenlet 4 29
// greenlet.tests.test_greenlet.convoluted 1 2
// greenlet.tests.test_leaks.HasFinalizerTracksInstances 2 2
// ------------------------------------------------------- ----- ----
// total 117 482
using greenlet::refs::BorrowedObject;
using greenlet::refs::BorrowedGreenlet;
using greenlet::refs::BorrowedMainGreenlet;
using greenlet::refs::OwnedObject;
using greenlet::refs::PyErrFetchParam;
using greenlet::refs::PyArgParseParam;
using greenlet::refs::ImmortalString;
using greenlet::refs::ImmortalObject;
using greenlet::refs::CreatedModule;
using greenlet::refs::PyErrPieces;
using greenlet::refs::PyObjectPointer;
using greenlet::Greenlet;
using greenlet::UserGreenlet;
using greenlet::MainGreenlet;
// ******* Implementation of things from included files
template<typename T, greenlet::refs::TypeChecker TC>
greenlet::refs::_BorrowedGreenlet<T, TC>& greenlet::refs::_BorrowedGreenlet<T, TC>::operator=(const greenlet::refs::BorrowedObject& other)
{
this->_set_raw_pointer(static_cast<PyObject*>(other));
return *this;
}
template <typename T, greenlet::refs::TypeChecker TC>
inline greenlet::refs::_BorrowedGreenlet<T, TC>::operator Greenlet*() const G_NOEXCEPT
{
if (!this->p) {
return nullptr;
}
return reinterpret_cast<PyGreenlet*>(this->p)->pimpl;
}
template<typename T, greenlet::refs::TypeChecker TC>
greenlet::refs::_BorrowedGreenlet<T, TC>::_
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
类似于客户管理系统,实现对管理员账户 部门账户 用户账户 靓号账户 任务发布 的增删查改,实现导入导出excel数据,生成pdf, 上传图片媒体资源。用户登录期间,随机图片验证码验证,登录账号的Cookie,Session保存。在增删删改期间,实现了 Ajax 页面无刷新上传数据。 在浏览数据信息方面,实现了模块级别的分页查询,实现了 e-chart 的数据可视化。在存储数据方面实现了md5 加密存储数据。Django 优点 1. 高度集成化:Django包含了很多常用功能,如自动化ORM系统、Form系统、Cache系统、Routing、Middleware、Template系统等,这样就能够很方便的使用这些功能,不需要自己来实现这些底层的功能。 2. 自动化Admin管理站点:Django自带一个基于Web的Admin管理站点,无需自行开发,可快速完成对模型的管理。 3. 强调面向对象编程思想:Django强调对模型、视图、控制器的封装,让开发人员更关注业务开发本身而不是技术层面,使代码结构更清晰。 4. 安全性较高:Django带有一些内置安全性功能,如防止跨站脚本攻击、C
资源推荐
资源详情
资源评论
收起资源包目录
python Django web 联通用户管理系统实训代码 (2000个子文件)
_test_extension.c 6KB
greenlet.cpp 108KB
_test_extension_cpp.cpp 6KB
bootstrap.css 143KB
bootstrap.min.css 119KB
bootstrap-theme.css 25KB
bootstrap-datepicker3.standalone.css 23KB
bootstrap-theme.min.css 23KB
bootstrap-datepicker3.css 22KB
bootstrap-datepicker3.standalone.min.css 21KB
base.css 21KB
bootstrap-datepicker3.min.css 21KB
responsive.css 18KB
bootstrap-datepicker.standalone.css 18KB
select2.css 17KB
bootstrap-datepicker.css 17KB
bootstrap-datepicker.standalone.min.css 16KB
bootstrap-datepicker.min.css 15KB
select2.min.css 15KB
widgets.css 12KB
autocomplete.css 9KB
forms.css 9KB
changelists.css 6KB
rtl.css 5KB
dark_mode.css 3KB
nav_sidebar.css 3KB
responsive_rtl.css 2KB
login.css 958B
ol3.css 773B
dashboard.css 441B
zlib.h 94KB
xsltInternals.h 56KB
parser.h 39KB
tree.h 37KB
xmlerror.h 36KB
schemasInternals.h 26KB
xmlwriter.h 21KB
xpathInternals.h 19KB
_embedding.h 18KB
lxml.etree_api.h 17KB
etree_api.h 17KB
parserInternals.h 17KB
xpath.h 16KB
zconf.h 16KB
etree_defs.h 15KB
_cffi_include.h 15KB
globals.h 14KB
valid.h 13KB
switch_x86_msvc.h 13KB
xmlreader.h 12KB
xmlIO.h 10KB
xmlunicode.h 10KB
HTMLparser.h 9KB
lxml.etree.h 9KB
etree.h 8KB
xmlversion.h 8KB
encoding.h 8KB
xsltutils.h 8KB
trio.h 7KB
xmlschemas.h 7KB
extensions.h 7KB
triodef.h 7KB
hash.h 6KB
transform.h 6KB
parse_c_type.h 6KB
relaxng.h 6KB
xmlmemory.h 6KB
xmlstring.h 5KB
xmlregexp.h 5KB
chvalid.h 5KB
debugXML.h 5KB
xlink.h 5KB
SAX2.h 5KB
catalog.h 5KB
xmlschemastypes.h 5KB
greenlet.h 5KB
greenlet.h 5KB
entities.h 5KB
schematron.h 4KB
SAX.h 4KB
_cffi_errors.h 4KB
xmlautomata.h 4KB
switch_ppc64_aix.h 4KB
xsltconfig.h 4KB
switch_ppc64_linux.h 4KB
nanoftp.h 4KB
HTMLtree.h 4KB
xsltexports.h 3KB
exsltexports.h 3KB
xpointer.h 3KB
list.h 3KB
slp_platformselect.h 3KB
variables.h 3KB
DOCBparser.h 3KB
c14n.h 3KB
switch_x86_unix.h 3KB
exslt.h 3KB
xinclude.h 3KB
switch_ppc_aix.h 3KB
win32config.h 3KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
丁金金
- 粉丝: 6090
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 筷手引流工具.apk
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功