清理了部分垃圾

This commit is contained in:
2026-07-19 11:42:41 +08:00
parent 7a8a3646db
commit 639f418530
34 changed files with 33 additions and 2293 deletions

View File

@@ -272,14 +272,19 @@ class _str:
def split(self, delimiter: str) -> list[str]:
stdio.printf("DBG split: entry\n")
stdio.fflush(None)
result = list[str](self.__mbuddy__)
stdio.printf("DBG split: list created\n")
stdio.fflush(None)
src: str = self.__data__
stdio.printf("DBG split: src=%s\n", src)
stdio.fflush(None)
length: t.CSizeT = len(src)
stdio.printf("DBG split: length=%lu\n", length)
stdio.fflush(None)
delim_len: t.CSizeT = string.strlen(delimiter)
stdio.printf("DBG split: delim_len=%lu\n", delim_len)
stdio.fflush(None)
start: t.CSizeT = 0
i: t.CSizeT = 0
cur: str = src

View File

@@ -1,6 +1,7 @@
import t, c
import memhub
import string
import stdio
from stdint import *
@@ -24,8 +25,12 @@ class list[T]:
__iter_index__: t.CSizeT
def __new__(self, pool: memhub.MemManager | t.CPtr, elem_size: t.CSizeT = 0):
# 堆分配 list[T] 对象 (6 字段 × 8 = 48 字节,无 vtable)
return pool.alloc(48)
stdio.printf("DBG __new__: entry\n")
stdio.fflush(None)
ret = pool.alloc(48)
stdio.printf("DBG __new__: alloc returned %p\n", ret)
stdio.fflush(None)
return ret
def __init__(self, pool: memhub.MemManager | t.CPtr, elem_size: t.CSizeT = 0):
self.__pool__ = pool