mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
Compare commits
2 Commits
9a23eb6c9e
...
054fcba7e4
Author | SHA1 | Date | |
---|---|---|---|
|
054fcba7e4 | ||
|
0c897df2c6 |
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
void pk_print_stack(VM* self, py_Frame* frame, Bytecode byte) {
|
void pk_print_stack(VM* self, py_Frame* frame, Bytecode byte) {
|
||||||
return;
|
return;
|
||||||
if(frame == NULL || py_isnil(self->main)) return;
|
if(frame == NULL || !self->main || py_isnil(self->main)) return;
|
||||||
|
|
||||||
py_TValue* sp = self->stack.sp;
|
py_TValue* sp = self->stack.sp;
|
||||||
c11_sbuf buf;
|
c11_sbuf buf;
|
||||||
|
@ -47,7 +47,10 @@ void py_newellipsis(py_OutRef out) {
|
|||||||
out->is_ptr = false;
|
out->is_ptr = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void py_newnil(py_OutRef out) { out->type = 0; }
|
void py_newnil(py_OutRef out) {
|
||||||
|
out->type = tp_nil;
|
||||||
|
out->is_ptr = false;
|
||||||
|
}
|
||||||
|
|
||||||
void py_newnativefunc(py_OutRef out, py_CFunction f) {
|
void py_newnativefunc(py_OutRef out, py_CFunction f) {
|
||||||
out->type = tp_nativefunc;
|
out->type = tp_nativefunc;
|
||||||
|
@ -16,7 +16,6 @@ d.__path__ = '__main__'
|
|||||||
d.a = []
|
d.a = []
|
||||||
d.gc = 1
|
d.gc = 1
|
||||||
|
|
||||||
print('-' * 100)
|
|
||||||
assert d.gc == 1
|
assert d.gc == 1
|
||||||
del d.a
|
del d.a
|
||||||
|
|
||||||
@ -32,4 +31,16 @@ assert d.gc == 1
|
|||||||
# 4 gc [4]
|
# 4 gc [4]
|
||||||
# 5 nil
|
# 5 nil
|
||||||
# 6 __path__ [2]
|
# 6 __path__ [2]
|
||||||
# 7 a [3]
|
# 7 a [3]
|
||||||
|
|
||||||
|
import gc
|
||||||
|
gc.collect()
|
||||||
|
|
||||||
|
a = []
|
||||||
|
del a
|
||||||
|
assert gc.collect() == 1
|
||||||
|
|
||||||
|
a = []
|
||||||
|
a.append(a)
|
||||||
|
del a
|
||||||
|
assert gc.collect() == 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user