aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 {