From ce421c6d05c7855ce50d0377362096f258335d4c Mon Sep 17 00:00:00 2001 From: Arslaan Pathan Date: Fri, 2 Oct 2026 19:08:12 +1300 Subject: Debugging stuff and basic PXObject test --- src/Object.m | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/Object.m') diff --git a/src/Object.m b/src/Object.m index d6fd2cb..71a2a7d 100644 --- a/src/Object.m +++ b/src/Object.m @@ -1,11 +1,24 @@ #include #include #include +#include @implementation PXObject + (instancetype)alloc { - return (id)class_createInstance(self, 0); + return class_createInstance(self, 0); +} + ++ (instancetype)allocDebug { + printf("alloc: self = %p\n", (void*)self); + printf("alloc: instance size = %zu\n", class_getInstanceSize(self)); + printf("alloc: sizeof(Class) = %zu\n", sizeof(Class)); + + id object = [self alloc]; + + printf("alloc: object = %p\n", (void*)object); + + return object; } - (instancetype)init { -- cgit v1.2.3