当前位置: 首页>>代码示例>>C++>>正文


C++ destroy_pool函数代码示例

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


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

示例1: tear_down

static void tear_down(void) {
  (void) unlink(trace_path);

  pr_inet_clear();
  pr_trace_set_options(PR_TRACE_OPT_DEFAULT);

  if (p) {
    destroy_pool(p);
    p = permanent_pool = NULL;
  } 
}
开发者ID:proftpd,项目名称:proftpd,代码行数:11,代码来源:trace.c

示例2: tear_down

static void tear_down(void) {
  if (getenv("TEST_VERBOSE") != NULL) {
    pr_trace_use_stderr(FALSE);
    pr_trace_set_levels("timers", 0, 0);
  }

  if (p) {
    destroy_pool(p);
    p = permanent_pool = NULL;
  } 
}
开发者ID:proftpd,项目名称:proftpd,代码行数:11,代码来源:timers.c

示例3: xaset_remove

config_rec *pr_parser_config_ctxt_close(int *empty) {
  config_rec *c = *parser_curr_config;

  /* Note that if the current config is empty, it should simply be removed.
   * Such empty configs can happen for <Directory> sections that
   * contain no directives, for example.
   */

  if (parser_curr_config == (config_rec **) parser_confstack->elts) {
    if (c != NULL &&
        (!c->subset || !c->subset->xas_list)) {
      xaset_remove(c->set, (xasetmember_t *) c);
      destroy_pool(c->pool);

      if (empty) {
        *empty = TRUE;
      }
    }

    if (*parser_curr_config) {
      *parser_curr_config = NULL;
    }

    return NULL;
  }

  if (c != NULL &&
      (!c->subset || !c->subset->xas_list)) {
    xaset_remove(c->set, (xasetmember_t *) c);
    destroy_pool(c->pool);

    if (empty) {
      *empty = TRUE;
    }
  }

  parser_curr_config--;
  parser_confstack->nelts--;

  return *parser_curr_config;
}
开发者ID:proftpd,项目名称:proftpd,代码行数:41,代码来源:parser.c

示例4: log_failure_restart_ev

static void log_failure_restart_ev(const void *event_data, void *user_data) {
  destroy_pool(log_failure_pool);
  log_failure_fields = NULL;

  log_failure_pool = make_sub_pool(permanent_pool);
  pr_pool_tag(log_failure_pool, MOD_LOG_FAILURE_VERSION);

  if (log_failure_mkfields(log_failure_pool) < 0) {
    pr_trace_msg(trace_channel, 3, "error creating fields table: %s",
      strerror(errno));
  }
}
开发者ID:Castaglia,项目名称:proftpd-mod_log_failure,代码行数:12,代码来源:mod_log_failure.c

示例5: main

int main()
{
	init_pool(&tp,threads_number);
	int i;
	for(i=0;i<10;i++)
	{
		add_task(&tp,task,NULL);
		printf("%s%d\n", "add ",i+1);
	}
	destroy_pool(&tp);
	return 0;
}
开发者ID:VectorWen,项目名称:C-ThreadPool,代码行数:12,代码来源:test.c

示例6: tear_down

static void tear_down(void) {
  pr_inet_clear();

  if (p) {
    destroy_pool(p);
    p = permanent_pool = NULL;
  } 

  if (getenv("TEST_VERBOSE") != NULL) {
    pr_trace_set_levels("inet", 0, 0);
  }
}
开发者ID:Nakor78,项目名称:proftpd,代码行数:12,代码来源:inet.c

示例7: tear_down

static void tear_down(void) {
  if (getenv("TEST_VERBOSE") != NULL) {
    pr_trace_set_levels("config", 0, 0);
  }

  pr_parser_cleanup();

  if (p) {
    destroy_pool(p);
    p = permanent_pool = NULL;
  } 
}
开发者ID:proftpd,项目名称:proftpd,代码行数:12,代码来源:configdb.c

示例8: main

/* main */
int main() {
    init_pool();
    init_env();
    init_stack_root();

    test();

    destroy_pool();
    stack_dispose(stack_root);

    return 0;
}
开发者ID:cpylua,项目名称:mark-sweep-gc,代码行数:13,代码来源:gc.c

示例9: proxy_ftp_sess_send_host

int proxy_ftp_sess_send_host(pool *p, struct proxy_session *proxy_sess) {
    pool *tmp_pool;
    int xerrno = 0;
    cmd_rec *cmd;
    pr_response_t *resp;
    unsigned int resp_nlines = 0;
    const char *host;

    if (pr_table_get(proxy_sess->backend_features, C_HOST, NULL) == NULL) {
        pr_trace_msg(trace_channel, 9,
                     "HOST not supported by backend server, ignoring");
        return 0;
    }

    tmp_pool = make_sub_pool(p);

    host = proxy_conn_get_host(proxy_sess->dst_pconn);
    cmd = pr_cmd_alloc(tmp_pool, 2, C_HOST, host);
    cmd->arg = pstrdup(tmp_pool, host);

    resp = send_recv(tmp_pool, proxy_sess->backend_ctrl_conn, cmd, &resp_nlines);
    if (resp == NULL) {
        xerrno = errno;
        destroy_pool(tmp_pool);
        errno = xerrno;
        return -1;
    }

    if (resp->num[0] != '2') {
        pr_trace_msg(trace_channel, 4,
                     "received unexpected %s response code %s from backend",
                     (char *) cmd->argv[0], resp->num);
        destroy_pool(tmp_pool);
        errno = EPERM;
        return -1;
    }

    destroy_pool(tmp_pool);
    return 0;
}
开发者ID:brownvin81,项目名称:proftpd-mod_proxy,代码行数:40,代码来源:sess.c

示例10: pr_stash_remove_cmd

/* Sentinel values:
 *
 *  cmd_type = 0
 *  cmd_group = NULL
 *  cmd_class = -1
 */
int pr_stash_remove_cmd(const char *cmd_name, module *m,
    unsigned char cmd_type, const char *cmd_group, int cmd_class) {
  int count = 0, prev_idx, symtab_idx = 0;
  size_t cmd_namelen = 0;
  unsigned int hash;
  cmdtable *tab = NULL;

  if (cmd_name == NULL) {
    errno = EINVAL;
    return -1;
  }

  /* Don't forget to include one for the terminating NUL. */
  cmd_namelen = strlen(cmd_name) + 1;

  hash = sym_type_hash(PR_SYM_CMD, cmd_name, cmd_namelen);
  symtab_idx = hash % PR_TUNABLE_HASH_TABLE_SIZE;
  prev_idx = -1;

  tab = pr_stash_get_symbol2(PR_SYM_CMD, cmd_name, NULL, &prev_idx, &hash);
  while (tab) {
    cmdtable *cmd_sym;

    pr_signals_handle();

    /* Note: this works because of a hack: the symbol lookup functions set a
     * static pointer, cmd_curr_sym, to point to the struct stash just looked
     * up.  cmd_curr_sym will not be NULL if pr_stash_get_symbol2() returns
     * non-NULL.
     */

    cmd_sym = cmd_curr_sym->ptr.sym_cmd;
    if ((m == NULL || cmd_curr_sym->sym_module == m) &&
        (cmd_type == 0 || cmd_sym->cmd_type == cmd_type) &&
        (cmd_group == NULL ||
         (cmd_group != NULL &&
          cmd_sym->group != NULL &&
          strcmp(cmd_sym->group, cmd_group) == 0)) &&
        (cmd_class == -1 || cmd_sym->cmd_class == cmd_class)) {
      xaset_remove(cmd_symbol_table[symtab_idx],
        (xasetmember_t *) cmd_curr_sym);
      destroy_pool(cmd_curr_sym->sym_pool);
      cmd_curr_sym = NULL;
      tab = NULL;
      count++;
    }

    tab = pr_stash_get_symbol2(PR_SYM_CMD, cmd_name, tab, &prev_idx, &hash);
  }

  return count;
}
开发者ID:proftpd,项目名称:proftpd,代码行数:58,代码来源:stash.c

示例11: tear_down

static void tear_down(void) {
  if (getenv("TEST_VERBOSE") != NULL) {
    pr_trace_set_levels("aws.http", 0, 0);
    pr_trace_set_levels("aws.cloudwatch.conn", 0, 0);
  }

  aws_http_free();

  if (p != NULL) {
    destroy_pool(p);
    p = permanent_pool = NULL;
  }
}
开发者ID:Castaglia,项目名称:proftpd-mod_aws,代码行数:13,代码来源:conn.c

示例12: pr_auth_endgrent

void pr_auth_endgrent(pool *p) {
  cmd_rec *cmd = NULL;

  cmd = make_cmd(p, 0);
  (void) dispatch_auth(cmd, "endgrent", NULL);

  if (cmd->tmp_pool) {
    destroy_pool(cmd->tmp_pool);
    cmd->tmp_pool = NULL;
  }

  return;
}
开发者ID:Distrotech,项目名称:proftpd,代码行数:13,代码来源:auth.c

示例13: dso_restart_ev

static void dso_restart_ev(const void *event_data, void *user_data) {
  module *m, *mi;
#ifdef PR_USE_CTRLS
  register unsigned int i = 0;
#endif /* PR_USE_CTRLS */

  if (dso_pool)
    destroy_pool(dso_pool);

  dso_pool = make_sub_pool(permanent_pool);
  pr_pool_tag(dso_pool, MOD_DSO_VERSION);

#ifdef PR_USE_CTRLS
  /* Re-register the control handlers */
  for (i = 0; dso_acttab[i].act_action; i++) {
    pool *sub_pool = make_sub_pool(dso_pool);

    /* Allocate and initialize the ACL for this control. */
    dso_acttab[i].act_acl = pcalloc(sub_pool, sizeof(ctrls_acl_t));
    dso_acttab[i].act_acl->acl_pool = sub_pool;
    pr_ctrls_init_acl(dso_acttab[i].act_acl);
  }
#endif /* PR_USE_CTRLS */

  /* Unload all shared modules. */
  for (mi = loaded_modules; mi; mi = m) {
#ifndef PR_USE_CTRLS
    register unsigned int i;
#endif /* PR_USE_CTRLS */
    int is_static = FALSE;

    m = mi->next;

    for (i = 0; static_modules[i]; i++) {
      if (strcmp(mi->name, static_modules[i]->name) == 0) {
        is_static = TRUE;
        break;
      }
    }

    if (!is_static) {
      pr_log_debug(DEBUG7, "unloading 'mod_%s.c'", mi->name);
      if (dso_unload_module(mi) < 0)
        pr_log_pri(PR_LOG_INFO, "error unloading 'mod_%s.c': %s",
          mi->name, strerror(errno));
    }
  }

  return;
}
开发者ID:Distrotech,项目名称:proftpd,代码行数:50,代码来源:mod_dso.c

示例14: tear_down

static void tear_down(void) {
  if (getenv("TEST_VERBOSE") != NULL) {
    pr_trace_set_levels("encode", 0, 0);
  }

#ifdef PR_USE_NLS
  encode_free();
#endif /* PR_USE_NLS */

  if (p) {
    destroy_pool(p);
    p = permanent_pool = NULL;
  }
}
开发者ID:Nakor78,项目名称:proftpd,代码行数:14,代码来源:encode.c

示例15: sftppam_driver_close

static int sftppam_driver_close(sftp_kbdint_driver_t *driver) {
  if (driver->driver_pool) {
    destroy_pool(driver->driver_pool);
    driver->driver_pool = NULL;
  }

  if (sftppam_user) {
    free(sftppam_user);
    sftppam_user = NULL;
    sftppam_userlen = 0;
  }

  return 0;
}
开发者ID:jmaggard10,项目名称:proftpd,代码行数:14,代码来源:mod_sftp_pam.c


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