feature/python-speedup #9

Open
s3rius wants to merge 2 commits from feature/python-speedup into master
6 changed files with 236 additions and 0 deletions
Showing only changes of commit 1c70581783 - Show all commits

View File

@ -1,4 +1,7 @@
#include <Python.h>
#include <print>
int test = 0;
PyObject* my_stat_counter(PyObject* self, PyObject* args) {
size_t to_add;
@ -8,8 +11,9 @@ PyObject* my_stat_counter(PyObject* self, PyObject* args) {
// PyObject* state = Py_None;
auto mod_shit = (size_t*)PyModule_GetState(self);
if (*mod_shit == 0) {
*mod_shit = 1;
if (mod_shit == NULL) {
std::println("heheheh fuck you");
return (PyObject*)NULL;
}
*mod_shit += to_add;