added anti aliasing. new fps game

This commit is contained in:
Masashi 2025-12-17 15:38:06 +05:30
commit 7b73c86113
40 changed files with 2386 additions and 564 deletions

View file

@ -112,6 +112,16 @@ static Obj *forward(Obj *obj) {
return new_obj;
}
static inline void scan_object_fields(Obj *obj) {
const TypeInfo *t = obj->header.type;
for (uint16_t i = 0; i < t->field_count; i++) {
if (t->pointer_bitmap[i]) {
obj->fields[i] = forward((Obj*)obj->fields[i]);
}
}
}
static void gc_minor_collect(void) {
gc.to_ptr = gc.to_space;
@ -189,16 +199,6 @@ void *gc_alloc(const TypeInfo *type, size_t payload_size) {
return obj;
}
static inline void scan_object_fields(Obj *obj) {
const TypeInfo *t = obj->header.type;
for (uint16_t i = 0; i < t->field_count; i++) {
if (t->pointer_bitmap[i]) {
obj->fields[i] = forward((Obj*)obj->fields[i]);
}
}
}
void gc_init(void) {
gc.young_size = YOUNG_SIZE;
gc.old_size = OLD_SIZE;