这篇教程C++ x_malloc函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中x_malloc函数的典型用法代码示例。如果您正苦于以下问题:C++ x_malloc函数的具体用法?C++ x_malloc怎么用?C++ x_malloc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了x_malloc函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: MibRegistermib_object_t *MibRegister( ul32 *Id, u16 IdLen, mib_callback_t Rqs, u16 Type, u16 Support, void *Param ){ mib_object_t *object; object = (mib_object_t *)x_malloc(sizeof(mib_object_t)); if (object == 0) { x_dbg("XSNMP, MibRegister: object is 0/n", TRUE); return 0; } if( !IdLen ) x_dbg("XSNMP, MibRegister: Idlen == 0/n", TRUE); object->Id = (ul32 *)x_malloc(IdLen * sizeof(l32)); if (object->Id == 0) { x_dbg("XSNMP, MibRegister: object->ID is 0/n", TRUE); return 0; } x_memcpy(object->Id, Id, IdLen * sizeof(l32)); object->IdLen = IdLen; object->Rqs = Rqs; object->Type = Type; object->Support = Support; object->Param = Param; if (!MibObjectInsert(object)) { x_free(object->Id); x_free(object); x_dbg("XSNMP, MibRegister: MibObjectInsert fail/n", TRUE); return 0; } return object;}
开发者ID:JoeAltmaier,项目名称:Odyssey,代码行数:33,
示例2: apply_voronoivoid apply_voronoi (hf_wrapper_struct *hfw) {// gint t1; if (!hfw->hf_struct->tmp_buf) hf_backup(hfw->hf_struct); if (!hfw->hf_struct->result_buf) hfw->hf_struct->result_buf = (hf_type *) x_malloc(sizeof(hf_type) * hfw->hf_struct->max_x * hfw->hf_struct->max_y, "hf_type (result_buf in apply_voronoi)"); if (!hfw->hf_struct->tmp2_buf) hfw->hf_struct->tmp2_buf = (hf_type *) x_malloc(sizeof(hf_type) * hfw->hf_struct->max_x * hfw->hf_struct->max_y, "hf_type (tmp2_buf in apply_voronoi)");// t1 = clock(); // Convention: // 1. tmp_buf: original HF // 2. tmp2_buf: distance HF // 3. result_buf: crackled HF (base level + black lines == cracks) // 4. hf_buf: output = crackled HF + distance HF (for lifting edges) set_watch_cursor(hfw); hf_voronoi(hfw->hf_struct, hfw->hf_options->img->voronoi); voronoi_adjust_edges (hfw->hf_struct->result_buf, hfw->hf_struct->hf_buf, hfw->hf_struct->tmp2_buf, hfw->hf_options->img->voronoi->edges_level, hfw->hf_struct->max_x, hfw->hf_struct->max_y); unset_watch_cursor(hfw);// printf("TEMPS DE CRAQU C++ x_return_val_if_fail函数代码示例 C++ x_check_conn函数代码示例
|