kentdlee / coco Goto Github PK
View Code? Open in Web Editor NEWThis is the CoCo Virtual Machine Source Code.
License: Other
This is the CoCo Virtual Machine Source Code.
License: Other
CoCo don't have garbage collection currently, so we have memory leak.
The PyObject.refCount may help if we call incRef,decRef when we need copy or delete PyObject.
But if we have circular reference, refCount won't work.
So we need GC strategy which can handle circular references. I'm trying to use Recycler:
[1] "A Pure Reference Counting Garbage Collector", 2001, Bacon, D. F., Attanasio, C. R., Rajan, V. T., Smith, S. E., & LEE, H.
https://github.com/thrunduil/cyclic_rc
#include "cyclic_rc/shared_ptr.h"
class PyObject;
using PyObjectPtr = cyclic_rc::shared_ptr<PyObject, false>;
class PyObject : public cyclic_rc::cyclic_rc_base<false> {
public:
PyObject();
virtual ~PyObject();
virtual void visit_children(int t) override {}
PyObjectPtr callMethod(PyObjectPtr& my_ptr, string name, vector<PyObjectPtr>* args);
...
};
class PyList : public PyObject {
public:
void visit_children(int t) override {
for (auto &i : data) {
i.visit_children(t);
}
}
protected:
vector<PyObjectPtr> data;
};
The built-in print function does not process strings right now for tabs, newlines, and other escape sequences like the other print functions do. This needs to be corrected. Probably should put the process string function in the util module.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.