1 Star 0 Fork 0

天高云淡/48_python_study

Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
cellObject.cpp 869 Bytes
Copy Edit Raw Blame History
天高云淡 authored 2024-12-09 20:23 +08:00 . pythonvm
//
// Created by Kosho on 2020/8/28.
//
#include "runtime/cellObject.hpp"
#include "object/hiList.hpp"
#include "object/hiDict.hpp"
#include "object/hiString.hpp"
#include "memory/oopClosure.hpp"
CellKlass *CellKlass::_instance = NULL;
CellKlass *CellKlass::get_instance() {
if (_instance == NULL) {
_instance = new CellKlass();
}
return _instance;
}
CellKlass::CellKlass() {
set_klass_dict(new HiDict());
set_name(new HiString("cell"));
}
CellObject::CellObject(HiList *t, int i) :
_table(t),
_index(i) {
set_klass(CellKlass::get_instance());
}
HiObject *CellObject::value() {
return _table->get(_index);
}
size_t CellKlass::size() {
return sizeof(CellKlass);
}
void CellKlass::oops_do(OopClosure *f, HiObject *obj) {
CellObject *co = (CellObject *) obj;
f->do_oop((HiObject **) &co->_table);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linux2014/48_python_study.git
git@gitee.com:linux2014/48_python_study.git
linux2014
48_python_study
48_python_study
master

Search