PythonMonkey   v0.3.1 (dev)
Loading...
Searching...
No Matches
pythonmonkey.hh
Go to the documentation of this file.
1
11#ifndef PythonMonkey_Module_PythonMonkey
12#define PythonMonkey_Module_PythonMonkey
13
14#include "include/PyType.hh"
15#include "include/JobQueue.hh"
16
17#include <jsapi.h>
18#include <js/CompilationAndEvaluation.h>
19#include <js/Initialization.h>
20
21#include <Python.h>
22
23#define PythonMonkey_Null PyObject_GetAttrString(PyState_FindModule(&pythonmonkey), "null")
24#define PythonMonkey_BigInt PyObject_GetAttrString(PyState_FindModule(&pythonmonkey), "bigint")
26extern JSContext *GLOBAL_CX;
27static JS::Rooted<JSObject *> *global;
28static JSAutoRealm *autoRealm;
29static JobQueue *JOB_QUEUE;
35static void cleanup();
36
46void memoizePyTypeAndGCThing(PyType *pyType, JS::Handle<JS::Value> GCThing);
47
56void handleSharedPythonMonkeyMemory(JSContext *cx, JSGCStatus status, JS::GCReason reason, void *data);
57
65static PyObject *collect(PyObject *self, PyObject *args);
66
74static PyObject *eval(PyObject *self, PyObject *args);
75
81PyMODINIT_FUNC PyInit_pythonmonkey(void);
82
87extern PyMethodDef PythonMonkeyMethods[];
88
93extern struct PyModuleDef pythonmonkey;
94
99extern PyObject *SpiderMonkeyError;
100#endif
Implement the ECMAScript Job Queue.
Struct representing python types.
Implement the ECMAScript Job Queue: https://www.ecma-international.org/ecma-262/9....
Definition JobQueue.hh:25
Definition __init__.py:1
PyMethodDef PythonMonkeyMethods[]
Array of method definitions for the pythonmonkey module.
Definition pythonmonkey.cc:426
PyMODINIT_FUNC PyInit_pythonmonkey(void)
Initialization function for the module. Starts the JSContext, creates the global object,...
Definition pythonmonkey.cc:445
void memoizePyTypeAndGCThing(PyType *pyType, JS::Handle< JS::Value > GCThing)
This function is used to memoize PyTypes and GCThings that use the same backing store for their data,...
Definition pythonmonkey.cc:220
PyObject * SpiderMonkeyError
PyObject for spidermonkey error type.
Definition pythonmonkey.cc:443
void handleSharedPythonMonkeyMemory(JSContext *cx, JSGCStatus status, JS::GCReason reason, void *data)
Callback function passed to JS_SetGCCallback to handle PythonMonkey shared memory.
Definition pythonmonkey.cc:234
JSContext * GLOBAL_CX
Definition JSObjectProxy.cc:32
Abstract struct that serves as a base for the different type relations in C++/Python.
Definition PyType.hh:22