aboutsummaryrefslogtreecommitdiff
path: root/src/Object.m
diff options
context:
space:
mode:
authorArslaan Pathan <[email protected]>2026-10-02 19:08:12 +1300
committerArslaan Pathan <[email protected]>2026-10-02 19:08:12 +1300
commitce421c6d05c7855ce50d0377362096f258335d4c (patch)
treeafada9f9d2fffc536bb7fa2667b71d9747f3a45b /src/Object.m
parent68bc96f76ad2de4077bc2a9916f4facbefe5f739 (diff)
downloadParadox-ce421c6d05c7855ce50d0377362096f258335d4c.tar.xz
Paradox-ce421c6d05c7855ce50d0377362096f258335d4c.zip
Debugging stuff and basic PXObject test
Diffstat (limited to 'src/Object.m')
-rw-r--r--src/Object.m15
1 files changed, 14 insertions, 1 deletions
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 <Paradox/Object.h>
#include <objc/objc.h>
#include <objc/runtime.h>
+#include <stdio.h>
@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 {