028-86922220

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

Category-创新互联

Category
int mcount = 0;
int i = cats->count; // cats 为分类数组
while (i--) {
	auto& entry = cats->list[i];
	method_list_t *mlist = entry.cat->methodsFoMeta(isMeta);
	
	mlists[mcount++] = mlist;
	
	// 后编译的分类方法先取出来添加到方法
	// ...
}
struct _category_t {
	const char *name;
	struct  _class_t *cls;
	const struct _method_list_t *instance_methods;
	const struct _method_list_t *class_methods;
	const struct _protocol_list_t *protocols;
	const struct _prop_list_t *properties;
};
void attachList(List* const * addedLists, uint32_t addedCount) {
	if (addedCount == 0) return;
	if (haveArray()) {
		uint32_t oldCount = array()->count;
		uint32_t newCount = oldCount + addedCount;
		setArray((array_t *)realloc(array(), array_t::byteSize(newCount)));
		array()->count = newCount;
		memmove(array()->lists, addedLists, addedCount * sizeof(array()->lists[0]));
		memcopy(array()->lists, addedLists, addedCount * sizeof(array()->lists[0]));
	}

}
void attachLists(List* const * addedLists, uint32_t addedCount) {
	if (addedCount == 0) return;
	
	if (hasArray()) {
	  // many lists ->many lists
	  uint32_t oldCount = array()->count;
	  uint32_t newCount = oldCount + addedCount;
	  array_t *newArray = (array_t *)malloc(array_t::byteSize(newCount));
	  newArray->count = newCount;
	  array()->count = newCount;
	
	  for (int i = oldCount - 1; i >= 0; i--)
	      newArray->lists[i + addedCount] = array()->lists[i];
	  for (unsigned i = 0; i< addedCount; i++)
	      newArray->lists[i] = addedLists[i];
	  free(array());
	  setArray(newArray);
	  validate();
	}
}

你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧


网页名称:Category-创新互联
标题网址:http://www.tsicrk.com/article/dicdpc.html

其他资讯

让你的专属顾问为你服务

0.7497s