这篇教程C++ vm_free函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中vm_free函数的典型用法代码示例。如果您正苦于以下问题:C++ vm_free函数的具体用法?C++ vm_free怎么用?C++ vm_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了vm_free函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: vm_free/** * Called to start a batch, you make sure you have enough memory * to store all the geometry, then you clear out the memory and set the * number of primitives to 0 */void geometry_batcher::allocate_internal(int n_verts){ if (n_verts > n_allocated) { if (vert != NULL) { vm_free(vert); vert = NULL; } if (radius_list != NULL) { vm_free(radius_list); radius_list = NULL; } vert = (vertex *) vm_malloc( sizeof(vertex) * n_verts ); radius_list = (float *) vm_malloc( sizeof(float) * n_verts ); Verify( (vert != NULL) ); Verify( (radius_list != NULL) ); memset( vert, 0, sizeof(vertex) * n_verts ); memset( radius_list, 0, sizeof(float) * n_verts ); n_allocated = n_verts; } n_to_render = 0; use_radius = true;}
开发者ID:RandomTiger,项目名称:fs2open.github.com,代码行数:34,
示例2: release_bitmapsvoid UI_WINDOW::destroy(){ UI_GADGET *cur; int idx; // free up any bitmaps release_bitmaps(); // destroy all gadgets if (first_gadget) { cur = first_gadget; do { cur->destroy(); cur = cur->next; } while (cur != first_gadget); } // free up all xstrs for(idx=0; idx<MAX_UI_XSTRS; idx++){ // free up this struct if(xstrs[idx] != NULL){ if(xstrs[idx]->xstr != NULL){ // This const_cast is safe since the string was allocated by vm_strdup vm_free(const_cast<char*>(xstrs[idx]->xstr)); } vm_free(xstrs[idx]); xstrs[idx] = NULL; } }}
开发者ID:Echelon9,项目名称:fs2open.github.com,代码行数:31,
示例3: vm_freevoid UI_INPUTBOX::destroy(){ if (text) { vm_free(text); text = NULL; } // free any valid chars if(valid_chars != NULL){ vm_free(valid_chars); valid_chars = NULL; } // free any invalid chars if(invalid_chars != NULL){ vm_free(invalid_chars); invalid_chars = NULL; } if ((flags & UI_INPUTBOX_FLAG_PASSWD) && passwd_text) { vm_free(passwd_text); passwd_text = NULL; } UI_GADGET::destroy();}
开发者ID:n-kawamt,项目名称:fs2open_snapshot,代码行数:26,
示例4: DisconnectFromChatServer/** * Call it to close the connection. It returns immediately */void DisconnectFromChatServer(){ if(!Socket_connected) return; SendChatString(NOX("/QUIT"),1); shutdown(Chatsock,2); closesocket(Chatsock); Socket_connecting = 0; Socket_connected = 0; Input_chat_buffer[0] = '/0'; if(User_list) { vm_free(User_list); User_list = NULL; } if(Chan_list) { vm_free(Chan_list); Chan_list = NULL; } Chat_server_connected = 0; Joining_channel = 0; Joined_channel = 0; RemoveAllChatUsers(); FlushChatCommandQueue(); return;}
开发者ID:PhantomHoover,项目名称:fs2open.github.com,代码行数:30,
示例5: mainint main(int argc, char *argv[]) { VM *vm = vm_create(hello, sizeof(hello), 0); vm_exec(vm, 0, false); vm_free(vm);// int t1 = (clock() / (CLOCKS_PER_SEC / 1000)); vm = vm_create(loop, sizeof(loop), 2); vm_exec(vm, 0, false); vm_print_data(vm->globals, vm->nglobals); vm_free(vm);// int t2 = (clock() / (CLOCKS_PER_SEC / 1000)); vm = vm_create(factorial, sizeof(factorial), 0); vm_exec(vm, 23, false); vm_free(vm); vm = vm_create(f, sizeof(f), 0); vm_exec(vm, 0, false); vm_free(vm);// printf("duration = %d ms/n", (t2 - t1)); return 0;}
开发者ID:AlexaBecker,项目名称:simple-virtual-machine-C,代码行数:25,
示例6: ToolsCoreRpcSetOptionstatic gbooleanToolsCoreRpcSetOption(RpcInData *data){ gboolean retVal = FALSE; char *option; char *value; unsigned int index = 0; ToolsServiceState *state = data->clientData; /* Parse the option & value string. */ option = StrUtil_GetNextToken(&index, data->args, " "); /* Ignore leading space before value. */ index++; value = StrUtil_GetNextToken(&index, data->args, ""); if (option != NULL && value != NULL && strlen(value) != 0) { g_debug("Setting option '%s' to '%s'./n", option, value); g_signal_emit_by_name(state->ctx.serviceObj, TOOLS_CORE_SIG_SET_OPTION, &state->ctx, option, value, &retVal); } vm_free(option); vm_free(value); RPCIN_SETRETVALS(data, retVal ? "" : "Unknown or invalid option", retVal); return retVal;}
开发者ID:angelovescio,项目名称:open-vm-tools,代码行数:34,
示例7: test_vm_allocint test_vm_alloc() { int i; int *baz, *buf = vm_zalloc(tvm, sizeof(int) * 16); ASSERT_NOTNULL(buf); for (i = 0; i < 16; ++i) ASSERT_EQ(int, buf[i], 0); vm_free(tvm, buf); buf = vm_zalloc(tvm, sizeof(int) * 4096); ASSERT_NOTNULL(buf); for (i = 0; i < 4096; ++i) ASSERT_EQ(int, buf[i], 0); vm_free(tvm, buf); buf = vm_zalloc(tvm, sizeof(int) * 32); for (i = 0; i < 32; ++i) ASSERT_EQ(int, buf[i], 0); baz = vm_realloc(tvm, buf, sizeof(int) * 4096); ASSERT_TRUE(buf == baz); for (i = 0; i < 32; ++i) ASSERT_EQ(int, baz[i], 0); vm_free(tvm, vm_zalloc(tvm, 16)); buf = vm_realloc(tvm, baz, sizeof(int) * 1024 * 4096); ASSERT_FALSE(buf == baz); return 0;}
开发者ID:ziyoudefeng,项目名称:ymd,代码行数:28,
示例8: test_vm_alloc_multiple_arguments/* check that multiple allocations create different maps */void test_vm_alloc_multiple_arguments(void){ vm_map_t map1, map2; const w_size_t num_pages = 10; const w_size_t num_frames = 4; w_ptr_t start1, start2; w_handle_t ram_handle1, ram_handle2; w_handle_t swap_handle1, swap_handle2; memset(&map1, 0, sizeof(vm_map_t)); memset(&map2, 0, sizeof(vm_map_t)); vmsim_init(); w_set_exception_handler(vmsim_test_segv_handler); vm_alloc(num_pages, num_frames, &map1); vm_alloc(num_pages, num_frames, &map2); start1 = map1.start; start2 = map2.start; ram_handle1 = map1.ram_handle; ram_handle2 = map2.ram_handle; swap_handle1 = map1.swap_handle; swap_handle2 = map2.swap_handle; vm_free(map1.start); vm_free(map2.start); vmsim_cleanup(); basic_test(start1 != start2 && ram_handle1 != ram_handle2 && swap_handle1 != swap_handle2);}
开发者ID:AndreiDuma,项目名称:lxchecker_so_tema3,代码行数:33,
示例9: RpcDebugDispatchstatic gbooleanRpcDebugDispatch(gpointer _chan){ gboolean ret; RpcChannel *chan = _chan; DbgChannelData *cdata = chan->_private; RpcDebugPlugin *plugin = cdata->plugin; RpcInData data; RpcDebugMsgMapping rpcdata; memset(&data, 0, sizeof data); memset(&rpcdata, 0, sizeof rpcdata); if (plugin->sendFn == NULL || !plugin->sendFn(&rpcdata)) { RpcDebug_DecRef(cdata->ctx); cdata->hasLibRef = FALSE; return FALSE; } else if (rpcdata.message == NULL) { /* * Nothing to send. Maybe the debug plugin is waiting for something to * happen before sending another message. */ return TRUE; } data.clientData = chan; data.appCtx = cdata->ctx; data.args = rpcdata.message; data.argsSize = rpcdata.messageLen; ret = RpcChannel_Dispatch(&data); if (rpcdata.validateFn != NULL) { ret = rpcdata.validateFn(&data, ret); } else if (!ret) { g_debug("RpcChannel_Dispatch returned error for RPC./n"); } if (data.freeResult) { vm_free(data.result); } if (rpcdata.freeMsg) { vm_free(rpcdata.message); } if (!ret) { VMTOOLSAPP_ERROR(cdata->ctx, 1); RpcDebug_DecRef(cdata->ctx); cdata->hasLibRef = FALSE; return FALSE; } return TRUE;}
开发者ID:AlissonGiron,项目名称:open-vm-tools,代码行数:53,
示例10: gsm_sms_get_unreadVMUINT8 gsm_sms_get_unread(void* userdata){ sms_unread_msg_struct *dest = (sms_unread_msg_struct*)userdata; VMINT16 message_id; vm_gsm_sms_read_message_data_t* message_data = NULL; VMWCHAR* content_buff; VMINT res; //message_id = vm_gsm_sms_get_message_id(VM_GSM_SMS_BOX_INBOX, 0); //dest -> id = message_id; message_id = dest->id; if(message_id >= 0) { // Allocates memory for the message data message_data = (vm_gsm_sms_read_message_data_t*)vm_calloc(sizeof(vm_gsm_sms_read_message_data_t)); if(message_data == NULL) { vm_log_info("sms read malloc message data fail"); return FALSE; } // Allocates memory for the content buffer of the message content_buff = (VMWCHAR*)vm_calloc((500+1)*sizeof(VMWCHAR)); if(content_buff == NULL) { vm_free(message_data); vm_log_info("sms read malloc content fail"); return FALSE; } message_data->content_buffer = content_buff; message_data->content_buffer_size = 500; // Reads the message res = vm_gsm_sms_read_message(message_id, VM_TRUE, message_data, sms_read_callback, NULL); //vm_log_info("vm_gsm_sms_read_message message_id is %d", message_id); if(res != VM_GSM_SMS_RESULT_OK) { vm_free(content_buff); vm_free(message_data); vm_log_info("register read callback fail"); return FALSE; } else { return TRUE; } }}
开发者ID:Frank-KunLi,项目名称:LinkItProjects,代码行数:52,
示例11: open_hx711ADC_HANDLE open_hx711(int scl_pin, int sda_pin){ ADC_HANDLE handle = 0; handle_details* details; hx711_task* task; while (open_handles[handle] != NULL) { handle++; if (handle > MAX_HANDLE) { return ADC_HANDLE_INVALID; } } details = vm_calloc(sizeof(handle_details)); if (details == NULL) { return ADC_HANDLE_INVALID; } task = &details->task; task->scl_handle = vm_dcl_open(VM_DCL_GPIO, scl_pin); if (task->scl_handle == VM_DCL_HANDLE_INVALID) { vm_free(details); return ADC_HANDLE_INVALID; } vm_dcl_control(task->scl_handle, VM_DCL_GPIO_COMMAND_SET_MODE_0, NULL); vm_dcl_control(task->scl_handle, VM_DCL_GPIO_COMMAND_SET_DIRECTION_OUT, NULL); vm_dcl_control(task->scl_handle, VM_DCL_GPIO_COMMAND_WRITE_HIGH, NULL); task->sda_handle = vm_dcl_open(VM_DCL_GPIO, sda_pin); if (task->sda_handle == VM_DCL_HANDLE_INVALID) { vm_dcl_close(task->scl_handle); vm_free(details); return ADC_HANDLE_INVALID; } vm_dcl_control(task->sda_handle, VM_DCL_GPIO_COMMAND_SET_MODE_0, NULL); vm_dcl_control(task->sda_handle, VM_DCL_GPIO_COMMAND_SET_DIRECTION_IN, NULL); vm_mutex_init(&details->mutex); task->op = WAIT; task->delay = 100; task->callback = dummy_callback; task->callback_env = NULL; open_handles[handle] = details; write_console("open/n"); vm_thread_create(measurement, (void*) details, (VM_THREAD_PRIORITY) 0); return handle;}
开发者ID:lantti,项目名称:RestessbarKSreporter,代码行数:52,
示例12: vm_freestatic uint8_t *vm_restore_frame(vm_context_t *ctx){ vm_callframe_t *frame; uint8_t *pc; vm_free(ctx->locals); frame = (vm_callframe_t *)vm_stack_pop(ctx->cstack); ctx->locals = frame->locals; pc = frame->return_pc; vm_free(frame); return pc;}
开发者ID:dev-zzo,项目名称:mette,代码行数:13,
示例13: mission_event_shutdown// called at the end of a mission for cleanupvoid mission_event_shutdown(){ int i; for (i=0; i<Num_mission_events; i++) { if (Mission_events[i].objective_text) { vm_free(Mission_events[i].objective_text); Mission_events[i].objective_text = NULL; } if (Mission_events[i].objective_key_text) { vm_free(Mission_events[i].objective_key_text); Mission_events[i].objective_key_text = NULL; } }}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:16,
示例14: anim_free/** * @brief Free an animation that was loaded with anim_load(). * @details All instances referencing this animation must be free'ed or get an assert. */int anim_free(anim *ptr){ Assert ( ptr != NULL ); anim *list, **prev_anim; list = first_anim; prev_anim = &first_anim; while (list && (list != ptr)) { prev_anim = &list->next; list = list->next; } if ( !list ) return -2; // only free when ref_count is 0 ptr->ref_count--; if ( ptr->ref_count > 0 ) return -1; // only free if there are no playing instances if ( ptr->instance_count > 0 ) return -1; if(ptr->keys != NULL){ vm_free(ptr->keys); ptr->keys = NULL; } if ( ptr->flags & (ANF_MEM_MAPPED|ANF_STREAMED) ) { cfclose(ptr->cfile_ptr); if (ptr->cache != NULL) { vm_free(ptr->cache); ptr->cache = NULL; } } else { Assert(ptr->data); if (ptr->data != NULL) { vm_free(ptr->data); ptr->data = NULL; } } *prev_anim = ptr->next; vm_free(ptr); return 0;}
开发者ID:X3N0-Life-Form,项目名称:fs2open.github.com,代码行数:52,
示例15: dock_evaluate_all_docked_objects// evaluate a certain function for all docked objectsvoid dock_evaluate_all_docked_objects(object *objp, dock_function_info *infop, void (*function)(object *, dock_function_info *)){ Assert((objp != NULL) && (infop != NULL) && (function != NULL)); // not docked? if (!object_is_docked(objp)) { // call the function for just the one object function(objp, infop); return; } // we only have two objects docked if (dock_check_docked_one_on_one(objp)) { // call the function for the first object, and return if instructed function(objp, infop); if (infop->early_return_condition) return; // call the function for the second object, and return if instructed function(objp->dock_list->docked_objp, infop); if (infop->early_return_condition) return; } // we have multiple objects docked and we're treating them as a hub else if (dock_check_assume_hub()) { // get the hub object *hub_objp = dock_get_hub(objp); // call the function for the hub, and return if instructed function(hub_objp, infop); if (infop->early_return_condition) return; // iterate through all docked objects for (dock_instance *ptr = hub_objp->dock_list; ptr != NULL; ptr = ptr->next) { // call the function for this object, and return if instructed function(ptr->docked_objp, infop); if (infop->early_return_condition) return; } } // we have multiple objects docked and we must treat them as a tree else { // create a bit array to mark the objects we check ubyte *visited_bitstring = (ubyte *) vm_malloc(calculate_num_bytes(MAX_OBJECTS)); // clear it memset(visited_bitstring, 0, calculate_num_bytes(MAX_OBJECTS)); // start evaluating the tree dock_evaluate_tree(objp, infop, function, visited_bitstring); // destroy the bit array vm_free(visited_bitstring); visited_bitstring = NULL; }}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:61,
示例16: io_libraryReleasevoid io_libraryRelease(io_library_t *library){ spinlock_lock(&library->lock); if((-- library->refCount) == 0) { struct io_dependency_s *dependency = list_first(library->dependencies); while(dependency) { io_libraryRelease(dependency->library); dependency = dependency->next; } io_storeRemoveLibrary(library); if(library->vmemory) vm_free(vm_getKernelDirectory(), library->vmemory, library->pages); if(library->pmemory) pm_free(library->pmemory, library->pages); hfree(NULL, library->path); list_destroy(library->dependencies); return; } spinlock_unlock(&library->lock);}
开发者ID:rostamn739,项目名称:Firedrake,代码行数:28,
示例17: gr_opengl_set_gammavoid gr_opengl_set_gamma(float gamma){ ushort *gamma_ramp = NULL; Gr_gamma = gamma; Gr_gamma_int = int (Gr_gamma*10); // new way - but not while running FRED if (!Fred_running && !Cmdline_no_set_gamma && os::getSDLMainWindow() != nullptr) { gamma_ramp = (ushort*) vm_malloc( 3 * 256 * sizeof(ushort), memory::quiet_alloc); if (gamma_ramp == NULL) { Int3(); return; } memset( gamma_ramp, 0, 3 * 256 * sizeof(ushort) ); // Create the Gamma lookup table opengl_make_gamma_ramp(gamma, gamma_ramp); SDL_SetWindowGammaRamp( os::getSDLMainWindow(), gamma_ramp, (gamma_ramp+256), (gamma_ramp+512) ); vm_free(gamma_ramp); }}
开发者ID:mirakus-0f-tyr,项目名称:fs2open.github.com,代码行数:26,
示例18: gr_opengl_shutdownvoid gr_opengl_shutdown(){ graphics::paths::PathRenderer::shutdown(); opengl_tcache_shutdown(); opengl_tnl_shutdown(); opengl_scene_texture_shutdown(); opengl_post_process_shutdown(); opengl_shader_shutdown(); GL_initted = false; glDeleteVertexArrays(1, &GL_vao); GL_vao = 0; if (GL_original_gamma_ramp != NULL && os::getSDLMainWindow() != nullptr) { SDL_SetWindowGammaRamp( os::getSDLMainWindow(), GL_original_gamma_ramp, (GL_original_gamma_ramp+256), (GL_original_gamma_ramp+512) ); } if (GL_original_gamma_ramp != NULL) { vm_free(GL_original_gamma_ramp); GL_original_gamma_ramp = NULL; } graphic_operations->makeOpenGLContextCurrent(nullptr, nullptr); GL_context = nullptr;}
开发者ID:mirakus-0f-tyr,项目名称:fs2open.github.com,代码行数:27,
示例19: http_gethostbynameworkerint http_gethostbynameworker(void *parm)#endif{#ifdef SCP_UNIX// df_pthread_detach(df_pthread_self());#endif async_dns_lookup *lookup = (async_dns_lookup *)parm; HOSTENT *he = gethostbyname(lookup->host); if(he==NULL) { lookup->error = true;#ifdef WIN32 return;#else return 0;#endif } else if(!lookup->abort) { memcpy(&lookup->ip,he->h_addr_list[0],sizeof(unsigned int)); lookup->done = true; memcpy(&httpaslu,lookup,sizeof(async_dns_lookup)); } vm_free(lookup);#ifdef SCP_UNIX return 0;#endif}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:29,
示例20: opengl_light_shutdownvoid opengl_light_shutdown(){ if (opengl_lights != NULL) { vm_free(opengl_lights); opengl_lights = NULL; }}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:7,
示例21: hud_add_line_to_scrollback// hud_add_msg_to_scrollback() adds the new_msg to the scroll-back message list. If there// are no more free slots, the first slot is released to make room for the new message.//void hud_add_line_to_scrollback(char *text, int source, int t, int x, int y, int underline_width){ line_node *new_line; Assert(HUD_msg_inited); if (!text || !strlen(text)) return; if ( EMPTY(&Msg_scrollback_free_list) ) { new_line = GET_FIRST(&Msg_scrollback_used_list); list_remove(&Msg_scrollback_used_list, new_line); vm_free(new_line->text); } else { new_line = GET_FIRST(&Msg_scrollback_free_list); list_remove(&Msg_scrollback_free_list, new_line); } new_line->x = x; new_line->y = y; new_line->underline_width = underline_width; new_line->time = t; new_line->source = source; new_line->text = (char *) vm_malloc( strlen(text) + 1 ); strcpy(new_line->text, text); list_append(&Msg_scrollback_used_list, new_line);}
开发者ID:rtoijala,项目名称:fs2open.github.com,代码行数:30,
示例22: popup_close// called when a popup goes awayvoid popup_close(popup_info *pi, int screen_id){ int i; gamesnd_play_iface(SND_POPUP_DISAPPEAR); // play sound when popup disappears for (i=0; i<pi->nchoices; i++ ) { if ( pi->button_text[i] != NULL ) { vm_free(pi->button_text[i]); pi->button_text[i] = NULL; } } if(screen_id >= 0){ gr_free_screen(screen_id); } Popup_window.destroy(); anim_ignore_next_frametime(); // to avoid skips in animation since next frametime is saturated game_flush(); Popup_is_active = 0; Popup_running_state = 0; // anytime in single player, and multiplayer, not in mission, go ahead and stop time if ( (Game_mode & GM_NORMAL) || ((Game_mode & GM_MULTIPLAYER) && !(Game_mode & GM_IN_MISSION)) ) game_start_time();}
开发者ID:Admiral-MS,项目名称:fs2open.github.com,代码行数:28,
示例23: https_get//=========================int https_get(lua_State* L){ int ret = 0; vm_https_callbacks_t callbacks = { (vm_https_set_channel_response_callback)https_send_request_set_channel_rsp_cb, (vm_https_unset_channel_response_callback)https_unset_channel_rsp_cb, (vm_https_release_all_request_response_callback)https_send_release_all_req_rsp_cb, (vm_https_termination_callback)https_send_termination_ind_cb, (vm_https_send_response_callback)https_send_read_request_rsp_cb, (vm_https_read_content_response_callback)https_send_read_read_content_rsp_cb, (vm_https_cancel_response_callback)https_send_cancel_rsp_cb, (vm_https_status_query_response_callback)https_send_status_query_rsp_cb }; size_t sl; const char* url = luaL_checklstring(L, 1, &sl); vm_free(g_https_url); g_https_url = vm_calloc(sl+1); strncpy(g_https_url, url, sl); vm_https_register_context_and_callback(gprs_bearer_type, &callbacks); if (ret != 0) { l_message(NULL, "register context & cb failed"); } else { ret = vm_https_set_channel(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); } lua_pushinteger(L, ret); return 1;}
开发者ID:craigcomstock,项目名称:RePhone_on_Linux,代码行数:31,
示例24: rtvoice_init_playback// Init the playback portion of the real-time voice system// exit: 0 => success// !0 => failure, playback not possibleint rtvoice_init_playback(){ rtv_format *rtvf=NULL; if ( !Rtv_playback_inited ) { rtvoice_reset_out_buffers(); Rtv_playback_format=0; rtvf = &Rtv_formats[Rtv_playback_format]; if ( Rtv_playback_uncompressed_buffer ) { vm_free(Rtv_playback_uncompressed_buffer); Rtv_playback_uncompressed_buffer=NULL; } Rtv_playback_uncompressed_buffer_size = rtvf->frequency * (RTV_BUFFER_TIME) * fl2i(rtvf->bits_per_sample/8.0f); Rtv_playback_uncompressed_buffer = (unsigned char*)vm_malloc(Rtv_playback_uncompressed_buffer_size); Assert(Rtv_playback_uncompressed_buffer); Rtv_playback_inited=1; } return 0;}
开发者ID:DahBlount,项目名称:Freespace-Open-Swifty,代码行数:28,
示例25: c3725_delete_instance/* Free resources used by a router instance */static int c3725_delete_instance(vm_instance_t *vm){ c3725_t *router = VM_C3725(vm); int i; /* Stop all CPUs */ if (vm->cpu_group != NULL) { vm_stop(vm); if (cpu_group_sync_state(vm->cpu_group) == -1) { vm_error(vm,"unable to sync with system CPUs./n"); return(FALSE); } } /* Remove NIO bindings */ for(i=0;i<vm->nr_slots;i++) vm_slot_remove_all_nio_bindings(vm,i); /* Shutdown all Network Modules */ vm_slot_shutdown_all(vm); /* Free mainboard EEPROM */ cisco_eeprom_free(&router->mb_eeprom); /* Free all resources used by VM */ vm_free(vm); /* Free the router structure */ free(router); return(TRUE);}
开发者ID:GNS3,项目名称:dynamips,代码行数:33,
示例26: fprintf/* Create an instance of the specified type */vm_instance_t *vm_create_instance(char *name,int instance_id,char *type){ vm_platform_t *platform; vm_instance_t *vm = NULL; if (!(platform = vm_platform_find(type))) { fprintf(stderr,"VM %s: unknown platform '%s'/n",name,type); goto error; } /* Create a generic VM instance */ if (!(vm = vm_create(name,instance_id,platform))) goto error; /* Initialize specific parts */ if (vm->platform->create_instance(vm) == -1) goto error; return vm; error: fprintf(stderr,"VM %s: unable to create instance!/n",name); vm_free(vm); return NULL;}
开发者ID:ShiningDrops,项目名称:dynamips,代码行数:26,
注:本文中的vm_free函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ vm_isokendpt函数代码示例 C++ vm_error函数代码示例 |