您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ util_safe_free函数代码示例

51自学网 2021-06-03 09:25:45
  C++
这篇教程C++ util_safe_free函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中util_safe_free函数的典型用法代码示例。如果您正苦于以下问题:C++ util_safe_free函数的具体用法?C++ util_safe_free怎么用?C++ util_safe_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了util_safe_free函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: gen_kw_parameter_free

static void gen_kw_parameter_free( gen_kw_parameter_type * parameter ) {  util_safe_free( parameter->name );  util_safe_free( parameter->tagged_name );  if (parameter->trans_func != NULL)    trans_func_free( parameter->trans_func );  free( parameter );}
开发者ID:danielfmva,项目名称:ert,代码行数:7,


示例2: util_alloc_file_components

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------void RifEclipseSummaryTools::findSummaryHeaderFileInfo(const std::string& inputFile, std::string* headerFile, std::string* path, std::string* base, bool* isFormatted){    char* myPath = NULL;    char* myBase = NULL;    bool formattedFile = true;    util_alloc_file_components(inputFile.data(), &myPath, &myBase, NULL);    char* myHeaderFile = ecl_util_alloc_exfilename(myPath, myBase, ECL_SUMMARY_HEADER_FILE, true, -1);    if (!myHeaderFile)    {        myHeaderFile = ecl_util_alloc_exfilename(myPath, myBase, ECL_SUMMARY_HEADER_FILE, false, -1);        if (myHeaderFile)        {            formattedFile = false;        }    }    if (myHeaderFile && headerFile) *headerFile = myHeaderFile;    if (myPath && path)             *path = myPath;    if (myBase && base)             *base = myBase;    if (isFormatted)                *isFormatted = formattedFile;    util_safe_free(myHeaderFile);    util_safe_free(myBase);    util_safe_free(myPath);}
开发者ID:magnesj,项目名称:ResInsight,代码行数:30,


示例3: site_config_free

void site_config_free(site_config_type * site_config) {  ext_joblist_free(site_config->joblist);  job_queue_free(site_config->job_queue);  hash_free(site_config->queue_drivers);  stringlist_free(site_config->path_variables_user);  stringlist_free(site_config->path_values_user);  hash_free(site_config->path_variables_site);  hash_free(site_config->env_variables_site);  hash_free(site_config->env_variables_user);  if (site_config->__license_root_path != NULL)    util_clear_directory(site_config->__license_root_path, true, true);  util_safe_free(site_config->manual_url);  util_safe_free(site_config->default_browser);  util_safe_free(site_config->license_root_path);  util_safe_free(site_config->license_root_path_site);  util_safe_free(site_config->__license_root_path);  util_safe_free(site_config->job_script);  util_safe_free(site_config->job_script_site);  util_safe_free(site_config->rsh_command_site);  util_safe_free(site_config->lsf_queue_name_site);  util_safe_free(site_config->lsf_request_site);  free(site_config);}
开发者ID:edbru,项目名称:ert,代码行数:28,


示例4: data_ranking_free

void data_ranking_free( data_ranking_type * ranking ) {    double_vector_free( ranking->data_ensemble );    bool_vector_free( ranking->valid );    util_safe_free( ranking->sort_permutation );    util_safe_free( ranking->user_key );    free( ranking );}
开发者ID:alfbr,项目名称:ResInsight,代码行数:7,


示例5: job_queue_free

void job_queue_free(job_queue_type * queue) {  util_safe_free( queue->ok_file );  util_safe_free( queue->exit_file );  job_list_free( queue->job_list );  job_queue_status_free( queue->status );  free(queue);}
开发者ID:agchitu,项目名称:ert,代码行数:7,


示例6: ecl_config_free

void ecl_config_free(ecl_config_type * ecl_config) {  ecl_io_config_free( ecl_config->io_config );  if (ecl_config->eclbase != NULL)     path_fmt_free( ecl_config->eclbase );  set_free( ecl_config->static_kw_set );  stringlist_free( ecl_config->user_static_kw );  util_safe_free(ecl_config->data_file);  if (ecl_config->sched_file != NULL)    sched_file_free(ecl_config->sched_file);  util_safe_free(ecl_config->schedule_target_file);  hash_free( ecl_config->fixed_length_kw );  util_safe_free(ecl_config->input_init_section);  util_safe_free(ecl_config->init_section);  util_safe_free(ecl_config->schedule_prediction_file);  if (ecl_config->grid != NULL)    ecl_grid_free( ecl_config->grid );  ecl_refcase_list_free( ecl_config->refcase_list );    free(ecl_config);}
开发者ID:JacobStoren,项目名称:ert,代码行数:26,


示例7: ecl_config_set_init_section

void ecl_config_set_init_section(ecl_config_type * ecl_config, const char * input_init_section) {  if (ecl_config->can_restart)  {     /* The <INIT> tag is set. */    ecl_config->input_init_section = util_realloc_string_copy(ecl_config->input_init_section, input_init_section); /* input_init_section = path/to/init_section         */    if (util_file_exists(ecl_config->input_init_section))    { /* init_section       = $CWD/path/to/init_section */      util_safe_free(ecl_config->init_section);      ecl_config->init_section = util_alloc_realpath(input_init_section);    }    else    {      char * path;      util_alloc_file_components(ecl_config->input_init_section, &path, NULL, NULL );      if (path != NULL )        fprintf(stderr,            "** Warning: %s: When INIT_SECTION:%s points to a non-existing file - you can not have any path components./n",            __func__, input_init_section);      else        ecl_config->init_section = util_alloc_string_copy(input_init_section);      util_safe_free(path);    }  }  else    /*        The <INIT> tag is not set - we can not utilize the       input_init_section info, and we just ignore it.     */    fprintf(stderr,        "** Warning: <INIT> tag was not found in datafile - can not utilize INIT_SECTION keyword - ignored./n");}
开发者ID:Ensembles,项目名称:ert,代码行数:32,


示例8: gen_kw_config_free

void gen_kw_config_free(gen_kw_config_type * gen_kw_config) {  util_safe_free( gen_kw_config->key );  util_safe_free( gen_kw_config->template_file );  util_safe_free( gen_kw_config->parameter_file );  vector_free( gen_kw_config->parameters );  free(gen_kw_config);}
开发者ID:danielfmva,项目名称:ert,代码行数:8,


示例9: field_config_free

void field_config_free(field_config_type * config) {    util_safe_free(config->ecl_kw_name);    util_safe_free(config->input_transform_name);    util_safe_free(config->output_transform_name);    util_safe_free(config->init_transform_name);    if ((config->private_grid) && (config->grid != NULL)) ecl_grid_free( config->grid );    free(config);}
开发者ID:bramirex,项目名称:ert,代码行数:8,


示例10: plot_free

/**   This function will close all pending/halfopen plot operations and   free all resources used by the plot.*/void plot_free( plot_type * plot ){  plot_driver_free( plot->driver );  plot_free_all_datasets(plot);  plot_range_free(plot->range);  util_safe_free(plot->timefmt);  util_safe_free(plot);}
开发者ID:akva2,项目名称:ResInsight,代码行数:12,


示例11: job_queue_node_free_data

void job_queue_node_free_data(job_queue_node_type * node) {  util_safe_free( node->job_name );  util_safe_free( node->exit_file );  util_safe_free( node->ok_file );  util_safe_free( node->run_cmd );  util_free_stringlist( node->argv , node->argc );  if (node->job_data != NULL)    util_abort("%s: internal error - driver spesific job data has not been freed - will leak./n",__func__);}
开发者ID:atgeirr,项目名称:ResInsight,代码行数:10,


示例12: gen_data_config_free

void gen_data_config_free(gen_data_config_type * config) {  int_vector_free( config->data_size_vector );    util_safe_free( config->key );  util_safe_free( config->template_buffer );  util_safe_free( config->template_file );  util_safe_free( config->template_key );  bool_vector_free( config->active_mask );    free(config);}
开发者ID:JacobStoren,项目名称:ert,代码行数:11,


示例13: plplot_state_close

static void plplot_state_close( plplot_state_type * state ) {  plsstrm(state->stream);  plend1();  plend();    util_safe_free( state->filename );  util_safe_free( state->device );  free( state->plbox_xopt );  free( state->plbox_yopt );  free( state );}
开发者ID:YingfangZhou,项目名称:ert,代码行数:11,


示例14: gen_data_config_reset_template

static void gen_data_config_reset_template( gen_data_config_type * config ) {  util_safe_free( config->template_buffer );   util_safe_free( config->template_key );   util_safe_free( config->template_file );  config->template_file = NULL;  config->template_buffer = NULL;  config->template_key = NULL;  config->template_data_offset = 0;  config->template_data_skip = 0;  config->template_buffer_size = 0;}
开发者ID:danielfmva,项目名称:ert,代码行数:12,


示例15: custom_kw_config_free

void custom_kw_config_free(custom_kw_config_type * config) {    util_safe_free(config->name);    util_safe_free(config->result_file);    util_safe_free(config->output_file);    util_safe_free(config->key_definition_file);    hash_free(config->custom_keys);    hash_free(config->custom_key_types);    pthread_rwlock_destroy(& config->rw_lock);    free(config);}
开发者ID:Ensembles,项目名称:ert,代码行数:13,


示例16: ecl_sum_set_case

void ecl_sum_set_case( ecl_sum_type * ecl_sum , const char * ecl_case) {  util_safe_free( ecl_sum->ecl_case );  util_safe_free( ecl_sum->path );  util_safe_free( ecl_sum->abs_path );  util_safe_free( ecl_sum->base );  util_safe_free( ecl_sum->ext );  {    char  *path , *base, *ext;    util_alloc_file_components( ecl_case , &path , &base , &ext);    ecl_sum->ecl_case = util_alloc_string_copy( ecl_case );    ecl_sum->path     = util_alloc_string_copy( path );    ecl_sum->base     = util_alloc_string_copy( base );    ecl_sum->ext      = util_alloc_string_copy( ext );    if (path != NULL)      ecl_sum->abs_path = util_alloc_abs_path( path );    else      ecl_sum->abs_path = util_alloc_cwd();    util_safe_free( base );    util_safe_free( path );    util_safe_free( ext );  }}
开发者ID:flikka,项目名称:ert,代码行数:25,


示例17: config_content_free

void config_content_free( config_content_type * content ) {  vector_free( content->nodes );  vector_free( content->path_elm_stack );  vector_free( content->path_elm_storage );  hash_free( content->items );  config_error_free( content->parse_errors );  subst_list_free( content->define_list );  util_safe_free( content->config_file );  util_safe_free( content->abs_path );  set_free( content->parsed_files );  if (content->invoke_path != NULL)    config_root_path_free( content->invoke_path );  free( content );}
开发者ID:agchitu,项目名称:ert,代码行数:15,


示例18: util_fprintf_backtrace

static void util_fprintf_backtrace(FILE * stream) {  const char * with_linenr_format = " #%02d %s(..) %s in %s:%d/n";  const char * func_format        = " #%02d %s(..) %s in ???/n";  const char * unknown_format     = " #%02d ???? /n";  const int max_bt = 100;  const int max_func_length = 70;  void *bt_addr[max_bt];  int    size,i;  size       = backtrace(bt_addr , max_bt);  fprintf(stream , "--------------------------------------------------------------------------------/n");  for (i=0; i < size; i++) {    int line_nr;    char * func_name;    char * file_name;    char * padding = NULL;    if (util_addr2line_lookup(bt_addr[i], &func_name , &file_name , &line_nr)) {      int pad_length;      char * function;      // Seems it can return true - but with func_name == NULL?! Static/inlinded functions?      if (func_name)        function = func_name;      else        function = "???";      pad_length = util_int_max (2, 2 + max_func_length - strlen(function));      padding = realloc_padding( padding , pad_length);      fprintf(stream , with_linenr_format , i , function , padding , file_name , line_nr);    } else {      if (func_name != NULL) {        int pad_length = util_int_max( 2 , 2 + max_func_length - strlen(func_name));        padding = realloc_padding( padding , pad_length);        fprintf(stream , func_format , i , func_name , padding);      } else {        padding = realloc_padding( padding , 2 + max_func_length );        fprintf(stream , unknown_format , i , padding);      }    }    util_safe_free( func_name );    util_safe_free( file_name );    util_safe_free( padding );  }  fprintf(stream , "--------------------------------------------------------------------------------/n");}
开发者ID:Ensembles,项目名称:ert,代码行数:48,


示例19: plot_config_free

void plot_config_free( plot_config_type * plot_config) {  free(plot_config->plot_path);  util_safe_free(plot_config->viewer);  free(plot_config->image_type);  free(plot_config->driver );  free(plot_config);}
开发者ID:JacobStoren,项目名称:ert,代码行数:7,


示例20: ecl_util_alloc_summary_data_files

void ecl_util_alloc_summary_data_files(const char * path , const char * base , bool fmt_file , stringlist_type * filelist) {  char  * unif_data_file = ecl_util_alloc_exfilename(path , base , ECL_UNIFIED_SUMMARY_FILE , fmt_file , -1);  int files = ecl_util_select_filelist( path , base , ECL_SUMMARY_FILE , fmt_file , filelist);  if ((files > 0) && (unif_data_file != NULL)) {    /*        We have both a unified file AND a list of files: BASE.S0000,       BASE.S0001, BASE.S0002, ..., must check which is newest and       load accordingly.    */    bool unified_newest = true;    int file_nr = 0;    while (unified_newest && (file_nr < files)) {      if (util_file_difftime( stringlist_iget(filelist , file_nr) , unif_data_file ) > 0)         unified_newest = false;      file_nr++;    }        if (unified_newest) {      stringlist_clear( filelist ); /* Clear out all the BASE.Snnnn selections. */      stringlist_append_copy( filelist , unif_data_file );    }   } else if (unif_data_file != NULL) {    /* Found a unified summary file :  Clear out all the BASE.Snnnn selections. */    stringlist_clear( filelist );      /* Clear out all the BASE.Snnnn selections. */    stringlist_append_copy( filelist , unif_data_file );  }   util_safe_free( unif_data_file );}
开发者ID:danielfmva,项目名称:ert,代码行数:29,


示例21: __ecl_kw_fscanf_alloc_grdecl__

static ecl_kw_type * __ecl_kw_fscanf_alloc_grdecl__(FILE * stream , const char * header , bool strict , int size , ecl_type_enum ecl_type) {  if (! (ecl_type == ECL_FLOAT_TYPE || ecl_type == ECL_INT_TYPE || ecl_type == ECL_DOUBLE_TYPE))    util_abort("%s: sorry only types FLOAT, INT and DOUBLE supported/n",__func__);  if (header != NULL)    if (!ecl_kw_grdecl_fseek_kw( header , true , stream ))      return NULL;  /* Could not find it. */  {    char file_header[9];    if (fscanf(stream , "%s" , file_header) == 1) {      int kw_size;      char * data = fscanf_alloc_grdecl_data( file_header , strict , ecl_type , &kw_size , stream );            // Verify size      if (size > 0)        if (size != kw_size) {          util_safe_free( data );          util_abort("%s: size mismatch when loading:%s. File:%d elements. Requested:%d elements /n",                     __func__ , file_header , kw_size , size);        }            {        ecl_kw_type * ecl_kw = ecl_kw_alloc_new( file_header , kw_size , ecl_type , NULL );        ecl_kw_set_data_ptr( ecl_kw , data );        return ecl_kw;      }    } else       /** No header read - probably at EOF */      return NULL;  }}
开发者ID:Bellout,项目名称:WIcalculation_ERTstudy,代码行数:33,


示例22: enkf_tui_fs_initialize_case_from_copy

void enkf_tui_fs_initialize_case_from_copy(void * arg) {  int prompt_len =50;  char * source_case;  int ens_size;  int last_report;  int src_step;  state_enum src_state;  enkf_main_type   * enkf_main = enkf_main_safe_cast( arg );  ens_size = enkf_main_get_ensemble_size( enkf_main );    last_report  = enkf_main_get_history_length( enkf_main );  source_case = enkf_tui_fs_alloc_existing_case( enkf_main , "Initialize from case" , prompt_len);  if (source_case != NULL) {                                                  src_step                 = util_scanf_int_with_limits("Source report step",prompt_len , 0 , last_report);    src_state                = enkf_tui_util_scanf_state("Source analyzed/forecast [A|F]" , prompt_len , false);    enkf_fs_type * source_fs = enkf_main_mount_alt_fs( enkf_main , source_case , false );    enkf_main_init_current_case_from_existing(enkf_main, source_fs , src_step , src_state);    enkf_fs_decref(source_fs);  }  util_safe_free( source_case );}
开发者ID:akva2,项目名称:ert,代码行数:25,


示例23: enkf_tui_run_exp

void enkf_tui_run_exp(void * enkf_main) {  const int ens_size          = enkf_main_get_ensemble_size( enkf_main );  bool_vector_type * iactive  = bool_vector_alloc(0,false);  state_enum init_state    = ANALYZED;   int start_report         = 0;  int init_step_parameters = 0;    {    char * prompt = util_alloc_sprintf("Which realizations to simulate (Ex: 1,3-5) <Enter for all> [M to return to menu] : " , ens_size);    char * select_string;          util_printf_prompt(prompt , PROMPT_LEN , '=' , "=> ");    select_string = util_alloc_stdin_line();    enkf_tui_util_sscanf_active_list( iactive , select_string , ens_size);    util_safe_free( select_string );    free( prompt );  }  if (bool_vector_count_equal(iactive , true))    enkf_main_run_exp(enkf_main , iactive , true , init_step_parameters , start_report , init_state, true);    bool_vector_free(iactive);}
开发者ID:PETECLAM,项目名称:ResInsight,代码行数:25,


示例24: config_content_add_path_elm

config_path_elm_type * config_content_add_path_elm( config_content_type * content , const char * path ) {  const config_path_elm_type * current_path_elm;  if (vector_get_size( content->path_elm_stack ) == 0)    current_path_elm = NULL;  else    current_path_elm = vector_get_last_const(content->path_elm_stack);  {    config_path_elm_type * new_path_elm;    {      char * rel_path = NULL;      config_root_path_type * invoke_path = config_content_get_invoke_path( content );      if (path != NULL) {        if (current_path_elm == NULL)          rel_path = util_alloc_rel_path( config_root_path_get_abs_path(invoke_path) , path);        else          rel_path = config_path_elm_alloc_relpath( current_path_elm , path );      }      new_path_elm = config_path_elm_alloc( invoke_path , rel_path );      util_safe_free( rel_path );    }    vector_append_owned_ref( content->path_elm_storage , new_path_elm , config_path_elm_free__);    vector_append_ref( content->path_elm_stack , new_path_elm );    return new_path_elm;  }}
开发者ID:agchitu,项目名称:ert,代码行数:28,


示例25: findSummaryHeaderFileInfo

//--------------------------------------------------------------------------------------------------/// //--------------------------------------------------------------------------------------------------std::vector<std::string> RifEclipseSummaryTools::findSummaryDataFiles(const std::string& caseFile){    std::vector<std::string> fileNames;    std::string path;    std::string base;    findSummaryHeaderFileInfo(caseFile, NULL, &path, &base, NULL);    if (path.empty() || base.empty()) return fileNames;    char* header_file = NULL;    stringlist_type* summary_file_list = stringlist_alloc_new();    ecl_util_alloc_summary_files(path.data(), base.data(), NULL, &header_file, summary_file_list);    if (stringlist_get_size( summary_file_list ) > 0)    {        for (int i = 0; i < stringlist_get_size(summary_file_list); i++)        {            fileNames.push_back(stringlist_iget(summary_file_list, i));        }    }    util_safe_free(header_file);    stringlist_free(summary_file_list);    return fileNames;}
开发者ID:magnesj,项目名称:ResInsight,代码行数:30,


示例26: ecl_grav_survey_free

static void ecl_grav_survey_free( ecl_grav_survey_type * grav_survey ) {  free( grav_survey->name );  util_safe_free( grav_survey->porv );  vector_free( grav_survey->phase_list );  hash_free( grav_survey->phase_map );  free( grav_survey );}
开发者ID:Bellout,项目名称:WIcalculation_ERTstudy,代码行数:7,


示例27: custom_kw_config_reset__

static void custom_kw_config_reset__(custom_kw_config_type * config) {    config->undefined = true;    hash_clear(config->custom_keys);    hash_clear(config->custom_key_types);    util_safe_free(config->key_definition_file);    config->key_definition_file = NULL;}
开发者ID:Ensembles,项目名称:ert,代码行数:7,


示例28: log_close

void log_close( log_type * logh ) {    if ((logh->stream != stdout) && (logh->stream != stderr) && (logh->stream != NULL))        fclose( logh->stream );  /* This closes BOTH the FILE * stream and the integer file descriptor. */    util_safe_free( logh->filename );    free( logh );}
开发者ID:jokva,项目名称:ert,代码行数:7,



注:本文中的util_safe_free函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ util_snprintf函数代码示例
C++ util_realloc_string_copy函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。