People *PeopleNew(int position,char *name,int age) { People * human = malloc(sizeof(People)); OBJECT_RETAIN(human); human->position = position; human->name = name; human->age = age; return human; }
void ArrayAdd(Array *arr,AnyPointer value) { if(arr->length_ >= arr->capacity_) { // int *newMem = malloc(sizeof(int)*arr->capacity_*2); arr->capacity_ *= 2; AnyPointer *oldValues = arr->values_; arr->values_ = allcoMemoryByCapacity(arr); memcpy(arr->values_, oldValues, sizeof(void*) * arr->length_); free(oldValues); } arr->values_[arr->length_] = value; arr->length_++; OBJECT_RETAIN(value); }