#include "runtime.h" #include "gc/gc.h" #include #include RavaMethodRef_t* rava_method_ref_create(const char *class_name, const char *method_name, bool is_constructor, bool is_static) { RavaMethodRef_t *ref = rava_gc_alloc(sizeof(RavaMethodRef_t), RAVA_GC_TYPE_METHODREF); if (!ref) return NULL; memset((char*)ref + sizeof(RavaGCHeader_t), 0, sizeof(RavaMethodRef_t) - sizeof(RavaGCHeader_t)); ref->class_name = class_name ? strdup(class_name) : NULL; ref->method_name = method_name ? strdup(method_name) : NULL; ref->is_constructor = is_constructor; ref->is_static = is_static; ref->has_target = false; return ref; } void rava_method_ref_destroy(RavaMethodRef_t *ref) { if (!ref) return; free(ref->class_name); free(ref->method_name); }