Consider the following:
typedef struct
{
float m00, m01, m02, m03;
float m10, m11, m12, m13;
float m20, m21, m22, m23;
float m30, m31, m32, m33;
} Matrix;
@interface TestClass : NSObject
{
Matrix matrix;
}
- (TestClass *) init;
@end
@implementation TestClass
- (TestClass *) init
{
self = [super init];
matrix = (Matrix) {1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
return self;
}
@end
How to ensure that the 64 bytes allocated with the struct are properly released whenever the "matrix" variable is not relevant anymore (or whenever the whole object is released)?