• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MEM_FREE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: valid

static int valid(char *ciphertext, struct fmt_main *self)
{
	char *ptr, *ctcopy, *keeptr;

	if (strncmp(ciphertext, "$episerver$*", 12))
		return 0;
	if (!(ctcopy = strdup(ciphertext)))
		return 0;
	keeptr = ctcopy;
	ctcopy += 12;	/* skip leading '$episerver$*' */
	if (strlen(ciphertext) > 255)
		goto error;
	if (!(ptr = strtokm(ctcopy, "*")))
		goto error;
	/* check version, must be '0' or '1' */
	if (*ptr != '0' && *ptr != '1')
		goto error;
	if (!(ptr = strtokm(NULL, "*")))	/* salt */
		goto error;
	if (strlen(ptr) > 24)
		goto error;
	if (!(ptr = strtokm(NULL, "*"))) /* hash */
		goto error;
	if (strlen(ptr) > 44)
		goto error;
	if ((ptr = strtokm(NULL, "*"))) /* end */
		goto error;
	MEM_FREE(keeptr);
	return 1;

error:
	MEM_FREE(keeptr);
	return 0;
}
开发者ID:Allen-smith,项目名称:ctf-tools,代码行数:34,代码来源:episerver_fmt_plug.c


示例2: freeFonts

/* Free font record */
static void freeFonts(tcCtx g) {
    tcprivCtx h = g->ctx.tcpriv;
    int i;

    /* Free font data */
    for (i = 0; i < h->set.cnt; i++) {
        Font *font = &h->set.array[i];

        MEM_FREE(g, font->FontName);
        dnaFREE(font->dict);
        dnaFREE(font->Private);
        csFreeFont(g, font);
        if (font->flags & FONT_CID) {
            int fdCount = font->fdCount;
            int fd;
            if (font->fdInfo) {
                for (fd = 0; fd < fdCount; fd++) {
                    dnaFREE(font->fdInfo[fd].FD);
                    dnaFREE(font->fdInfo[fd].Private);
                }
                MEM_FREE(g, font->fdInfo);
            }
            MEM_FREE(g, font->fdIndex);
        }
        MEM_FREE(g, font->chameleon.data);
        (void)fontInit(g, 1, font); /* Prepare to reuse */
    }
    h->set.cnt = 0;
}
开发者ID:adobe-type-tools,项目名称:afdko,代码行数:30,代码来源:tc.c


示例3: done

static void done(void)
{
	/* FIXME: How do we de-init cuda stuff? */
	MEM_FREE(ghash);
	MEM_FREE(g_ext_key);
	MEM_FREE(gkey);
}
开发者ID:Allen-smith,项目名称:ctf-tools,代码行数:7,代码来源:cuda_xsha512_fmt_plug.c


示例4: int

/*
 *  sets the current section
 */
int (conf_section)(const char *sec)
{
    size_t len;
    char buf[30], *pbuf;
    const char *hkey;
    table_t *tab;

    assert(sec);

    /* sepunit() always clears errcode */

    len = strlen(sec);
    pbuf = strcpy((len > sizeof(buf)-1)? MEM_ALLOC(len+1): buf, sec);

    if (sepunit(pbuf, &pbuf) != CONF_ERR_OK) {
        if (pbuf != buf)
            MEM_FREE(pbuf);
        return errcode;    /* sepunit sets errcode */
    }

    hkey = hash_string((control & CONF_OPT_CASE)? pbuf: lower(pbuf));
    if (pbuf != buf)
        MEM_FREE(pbuf);

    tab = table_get(section, hkey);
    if (tab)
        current = tab;
    else
        errcode = CONF_ERR_SEC;

    return errcode;
}
开发者ID:mycoboco,项目名称:beluga,代码行数:35,代码来源:conf.c


示例5: ensure_allocated

/*******************************************************************************
 *
 * Helper functions.
 *
 ******************************************************************************/
static enum sl_error
ensure_allocated(struct sl_vector* vec, size_t capacity, bool keep_data)
{
  void* buffer = NULL;
  enum sl_error sl_err = SL_NO_ERROR;
  ASSERT(vec);

  if(capacity > vec->capacity) {
    size_t new_capacity = 0;
    NEXT_POWER_OF_2(capacity, new_capacity);
    buffer = MEM_ALIGNED_ALLOC
      (vec->allocator, new_capacity * vec->data_size, vec->data_alignment);
    if(!buffer) {
      sl_err = SL_MEMORY_ERROR;
      goto error;
    }
    if(keep_data) {
      buffer = memcpy(buffer, vec->buffer, vec->capacity * vec->data_size);
    }
    MEM_FREE(vec->allocator, vec->buffer);
    vec->buffer = buffer;
    vec->capacity = new_capacity;
    buffer = NULL;
  }

exit:
  return sl_err;
error:
  if(buffer) {
    MEM_FREE(vec->allocator, buffer);
    buffer = NULL;
  }
  goto exit;
}
开发者ID:vaplv,项目名称:sl,代码行数:39,代码来源:sl_vector.c


示例6: valid

static int valid(char *ciphertext, struct fmt_main *self)
{
	char *ctcopy, *keeptr, *p;
	if (strncmp(ciphertext,  "$keychain$*", 11) != 0)
		return 0;
	ctcopy = strdup(ciphertext);
	keeptr = ctcopy;
	ctcopy += 11;
	if ((p = strtokm(ctcopy, "*")) == NULL)	/* salt */
		goto err;
	if(strlen(p) != SALTLEN * 2)
		goto err;
	if ((p = strtokm(NULL, "*")) == NULL)	/* iv */
		goto err;
	if(strlen(p) != IVLEN * 2)
		goto err;
	if ((p = strtokm(NULL, "*")) == NULL)	/* ciphertext */
		goto err;
	if(strlen(p) != CTLEN * 2)
		goto err;

	MEM_FREE(keeptr);
	return 1;

err:
	MEM_FREE(keeptr);
	return 0;
}
开发者ID:Allen-smith,项目名称:ctf-tools,代码行数:28,代码来源:keychain_fmt_plug.c


示例7: release_clobj

static void release_clobj(void)
{
	HANDLE_CLERROR(clReleaseMemObject(mem_in), "Release mem in");
	HANDLE_CLERROR(clReleaseMemObject(mem_out), "Release mem out");

	MEM_FREE(ghash);
	MEM_FREE(gkey);
}
开发者ID:balidani,项目名称:JohnTheRipper,代码行数:8,代码来源:opencl_rawsha512_fmt.c


示例8: wav_free

void wav_free(RawSound* sound) {
	assert(sound);
	assert(sound->data);

	MEM_FREE(sound->data);
	sound->data = NULL;
	MEM_FREE(sound);
}
开发者ID:ppiecuch,项目名称:Skeleton-Key-Marmalade,代码行数:8,代码来源:wav.c


示例9: done

static void done(void)
{
    int i;

    for (i = 0; i < 8; i++)
        MEM_FREE(crypt_key[i]);
    MEM_FREE(saved_key);
}
开发者ID:Allen-smith,项目名称:ctf-tools,代码行数:8,代码来源:rawSHA512_ng_fmt_plug.c


示例10: done

static void done(void)
{
	MEM_FREE(crypt_out);
	MEM_FREE(saved_key);
#ifndef SIMD_COEF_64
	MEM_FREE(saved_len);
#endif
}
开发者ID:Allen-smith,项目名称:ctf-tools,代码行数:8,代码来源:rawSHA384_fmt_plug.c


示例11: done

static void done(void)
{
	MEM_FREE(crypt_key);
	MEM_FREE(saved_key);
#ifdef SIMD_COEF_32
	MEM_FREE(saved_len);
#endif
}
开发者ID:Allen-smith,项目名称:ctf-tools,代码行数:8,代码来源:salted_sha1_fmt_plug.c


示例12: SQLReadFileDSNW

BOOL INSTAPI
SQLReadFileDSNW (LPCWSTR lpszFileName, LPCWSTR lpszAppName,
                 LPCWSTR lpszKeyName, LPWSTR lpszString, WORD cbString, WORD * pcbString)
{
    char *_filename_u8 = NULL;
    char *_appname_u8 = NULL;
    char *_keyname_u8 = NULL;
    char *_string_u8 = NULL;
    BOOL retcode = FALSE;

    _filename_u8 = (char *) dm_SQL_WtoU8 ((SQLWCHAR *) lpszFileName, SQL_NTS);
    if (_filename_u8 == NULL && lpszFileName)
    {
        PUSH_ERROR (ODBC_ERROR_OUT_OF_MEM);
        goto done;
    }

    _appname_u8 = (char *) dm_SQL_WtoU8 ((SQLWCHAR *) lpszAppName, SQL_NTS);
    if (_appname_u8 == NULL && lpszAppName)
    {
        PUSH_ERROR (ODBC_ERROR_OUT_OF_MEM);
        goto done;
    }

    _keyname_u8 = (char *) dm_SQL_WtoU8 ((SQLWCHAR *) lpszKeyName, SQL_NTS);
    if (_keyname_u8 == NULL && lpszKeyName)
    {
        PUSH_ERROR (ODBC_ERROR_OUT_OF_MEM);
        goto done;
    }

    if (cbString > 0)
    {
        if ((_string_u8 = malloc (cbString * UTF8_MAX_CHAR_LEN + 1)) == NULL)
        {
            PUSH_ERROR (ODBC_ERROR_OUT_OF_MEM);
            goto done;
        }
    }

    retcode =
        SQLReadFileDSN (_filename_u8, _appname_u8, _keyname_u8, _string_u8,
                        cbString * UTF8_MAX_CHAR_LEN, pcbString);

    if (retcode == TRUE)
    {
        dm_StrCopyOut2_U8toW (_string_u8, lpszString, cbString, pcbString);
    }

done:
    MEM_FREE (_filename_u8);
    MEM_FREE (_appname_u8);
    MEM_FREE (_keyname_u8);
    MEM_FREE (_string_u8);

    return retcode;
}
开发者ID:openlink,项目名称:iODBC,代码行数:57,代码来源:SQLReadFileDSN.c


示例13: find_best_workgroup

static void find_best_workgroup(int jtrUniqDevNo) {
        size_t 		 _lws=0;
	cl_device_type 	 dTyp;
	cl_command_queue cmdq;
	cl_int 		 err;
	cl_uint 	 *dcc_hash_host
		       = (cl_uint*)mem_alloc(4 * sizeof(cl_uint) * ((MAX_KEYS_PER_CRYPT < 65536) ? MAX_KEYS_PER_CRYPT : 65536));
	cl_uint 	 *dcc2_hash_host
		       = (cl_uint*)mem_alloc(4 * sizeof(cl_uint) * ((MAX_KEYS_PER_CRYPT < 65536) ? MAX_KEYS_PER_CRYPT : 65536));
	cl_uint salt_api[9], length = 10;

	event_ctr = 0;

	//HANDLE_CLERROR(clGetDeviceInfo(devices[jtrUniqDevNo], CL_DEVICE_TYPE, sizeof(cl_device_type), &dTyp, NULL), "Failed Device Info");
	dTyp = get_device_type(jtrUniqDevNo);
	if (dTyp == CL_DEVICE_TYPE_CPU)
		globalObj[jtrUniqDevNo].lws = 1;
	else
		globalObj[jtrUniqDevNo].lws = 16;

	///Set Dummy DCC hash , unicode salt and ascii salt(username) length
	memset(dcc_hash_host, 0xb5, 4 * sizeof(cl_uint) * ((MAX_KEYS_PER_CRYPT < 65536) ? MAX_KEYS_PER_CRYPT : 65536));
	memset(salt_api, 0xfe, 9 * sizeof(cl_uint));

	cmdq = clCreateCommandQueue(context[jtrUniqDevNo], devices[jtrUniqDevNo], CL_QUEUE_PROFILING_ENABLE, &err);
	HANDLE_CLERROR(err, "Error creating command queue");

	PROFILE = 1;
	kernelExecTimeNs = CL_ULONG_MAX;

	///Find best local work size
	while (1) {
		_lws = globalObj[jtrUniqDevNo].lws;
		if (dTyp == CL_DEVICE_TYPE_CPU) {
			exec_pbkdf2(dcc_hash_host, salt_api, length, dcc2_hash_host, 4096, jtrUniqDevNo, cmdq);
			globalObj[jtrUniqDevNo].exec_time_inv = globalObj[jtrUniqDevNo].exec_time_inv / 16;
		}
		else {
			exec_pbkdf2(dcc_hash_host, salt_api, length, dcc2_hash_host, ((MAX_KEYS_PER_CRYPT < 65536) ? MAX_KEYS_PER_CRYPT : 65536), jtrUniqDevNo, cmdq);
			globalObj[jtrUniqDevNo].exec_time_inv *= ((MAX_KEYS_PER_CRYPT < 65536) ? MAX_KEYS_PER_CRYPT : 65536) / 65536;
		}

		if (globalObj[jtrUniqDevNo].lws <= _lws) break;
	}

	PROFILE = 0;

	if (options.verbosity > 2) {
		fprintf(stderr, "Optimal Work Group Size:%d\n", (int)globalObj[jtrUniqDevNo].lws);
		fprintf(stderr, "Kernel Execution Speed (Higher is better):%Lf\n", globalObj[jtrUniqDevNo].exec_time_inv);
	}

	MEM_FREE(dcc_hash_host);
	MEM_FREE(dcc2_hash_host);
	HANDLE_CLERROR(clReleaseCommandQueue(cmdq), "Release Command Queue:Failed");
}
开发者ID:balidani,项目名称:JohnTheRipper,代码行数:56,代码来源:common_opencl_pbkdf2.c


示例14: release_clobj

static void release_clobj(void)
{
	HANDLE_CLERROR(clReleaseMemObject(mem_in), "Release mem in");
	HANDLE_CLERROR(clReleaseMemObject(mem_setting), "Release mem setting");
	HANDLE_CLERROR(clReleaseMemObject(mem_out), "Release mem out");

	MEM_FREE(inbuffer);
	MEM_FREE(outbuffer);
	MEM_FREE(cracked);
}
开发者ID:balidani,项目名称:JohnTheRipper,代码行数:10,代码来源:opencl_zip_fmt.c


示例15: done

static void done(void)
{
	int i;

	for (i = 0; i < max_threads; i++)
		escrypt_free_local(&local[i]);

	MEM_FREE(local);
	MEM_FREE(buffer);
}
开发者ID:mimaun,项目名称:Rose,代码行数:10,代码来源:scrypt_fmt.c


示例16: release_clobj

static void release_clobj(void)
{
	HANDLE_CLERROR(clReleaseMemObject(mem_in), "Release mem in");
	HANDLE_CLERROR(clReleaseMemObject(mem_salt), "Release mem salt");
	HANDLE_CLERROR(clReleaseMemObject(mem_out), "Release mem out");

	MEM_FREE(host_pass);
	MEM_FREE(host_hash);
	MEM_FREE(host_salt);
}
开发者ID:mimaun,项目名称:Rose,代码行数:10,代码来源:opencl_pwsafe_fmt_plug.c


示例17: t13Support

static int t13Support(cffCtx h)
	{
	/* Change op stack size */
	MEM_FREE(h, h->stack.array);
	MEM_FREE(h, h->stack.type);
	h->stack.max = T13_MAX_OP_STACK;
	h->stack.array = MEM_NEW(h, T13_MAX_OP_STACK * sizeof(StkElement));
	h->stack.type = MEM_NEW(h, T13_MAX_OP_STACK);
	return 1;
	}
开发者ID:Acidburn0zzz,项目名称:afdko,代码行数:10,代码来源:t13supp.c


示例18: done

static void done(void)
{
	if (overlap) {
		cuda_pageLockedFree(inbuffer);
		cuda_pageLockedFree(outbuffer);
	} else {
		MEM_FREE(inbuffer);
		MEM_FREE(outbuffer);
	}
}
开发者ID:Allen-smith,项目名称:ctf-tools,代码行数:10,代码来源:cuda_rawsha256_fmt.c


示例19: BF_clear_buffer

void BF_clear_buffer() {
	clean_gpu_buffer(&buffers[gpu_id]);
	MEM_FREE(BF_current_S) ;
	MEM_FREE(BF_current_P) ;
	MEM_FREE(BF_init_key) ;
	MEM_FREE(opencl_BF_out) ;
	HANDLE_CLERROR(clReleaseKernel(krnl[gpu_id]), "Error releasing kernel") ;
	HANDLE_CLERROR(clReleaseProgram(program[gpu_id]),
	               "Error releasing Program");
}
开发者ID:Allen-smith,项目名称:ctf-tools,代码行数:10,代码来源:opencl_bf_std_plug.c


示例20: SQLFreeConnect

RETCODE SQL_API 
SQLFreeConnect (HDBC hdbc)
{
  GENV_t FAR *genv;
  DBC_t FAR *pdbc = (DBC_t FAR *) hdbc;
  DBC_t FAR *tpdbc;

  if (hdbc == SQL_NULL_HDBC)
    {
      return SQL_INVALID_HANDLE;
    }

  /* check state */
  if (pdbc->state != en_dbc_allocated)
    {
      PUSHSQLERR (pdbc->herr, en_S1010);

      return SQL_ERROR;
    }

  genv = (GENV_t FAR *) pdbc->genv;

  for (tpdbc = (DBC_t FAR *) genv->hdbc;
      tpdbc != NULL;
      tpdbc = tpdbc->next)
    {
      if (pdbc == tpdbc)
	{
	  genv->hdbc = pdbc->next;
	  break;
	}

      if (pdbc == tpdbc->next)
	{
	  tpdbc->next = pdbc->next;
	  break;
	}
    }

  /* free this dbc */
  _iodbcdm_driverunload (pdbc);
  _iodbcdm_freesqlerrlist (pdbc->herr);

  if (pdbc->tfile)
    {
      MEM_FREE (pdbc->tfile);
    }

  SQLSetConnectOption (pdbc, SQL_OPT_TRACE, SQL_OPT_TRACE_OFF);

  MEM_FREE (pdbc);

  return SQL_SUCCESS;
}
开发者ID:252525fb,项目名称:rpcs3,代码行数:54,代码来源:hdbc.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MEM_Free函数代码示例发布时间:2022-05-30
下一篇:
C++ MEM_ERROR函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap