feature/python-speedup #9
@ -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;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user