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


C++ FREE_MEM函数代码示例

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


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

示例1: Hvl11Free

VOID
Hvl11Free(
    _In_ _Post_ptr_invalid_  PHVL pHvl
    )
{
    if (NULL != pHvl)
    {
        HvlWaitForPendingThreads(pHvl);
        
        NdisFreeSpinLock(&(pHvl->Lock));
        
        if (pHvl->CtxSWorkItemHandle)
        {
            NdisFreeIoWorkItem(pHvl->CtxSWorkItemHandle);
        }
        
        if (pHvl->NotificationsWorkItemHandle)
        {
            NdisFreeIoWorkItem(pHvl->NotificationsWorkItemHandle);
        }

        if (pHvl->pPnpOpExReq)
        {
            FREE_MEM(pHvl->pPnpOpExReq);
        }

        // free the memory allocated for any pending operations
        HvlDeleteAllPendingOperations(pHvl);
        
        FREE_MEM(pHvl);
    }
}
开发者ID:340211173,项目名称:Driver,代码行数:32,代码来源:hvl_main.c

示例2: MVMul

bool MVMul()
{
	bool bRtn = false;
	double	i, j;

	if (0 == g_matrix.fRowCount || 0 == g_matrix.fColumnCount || 0 == g_vector_input.fRowCount || g_vector_input.fRowCount != g_matrix.fColumnCount)
		return bRtn;

	g_vector_output.fRowCount = g_matrix.fRowCount;
	g_vector_output.pfReal = (double*)malloc(sizeof(double)*g_vector_output.fRowCount);
	g_vector_output.pfImaginary = (double*)malloc(sizeof(double)*g_vector_output.fRowCount);

	if (NULL == g_vector_output.pfReal || NULL == g_vector_output.pfImaginary)
	{
		FREE_MEM(g_vector_output.pfReal);
		FREE_MEM(g_vector_output.pfImaginary);
		return bRtn;
	}

	for (i = 0; i < g_matrix.fRowCount; ++i)
	{
		g_vector_output.pfReal[(int)i] = 0.;
		g_vector_output.pfImaginary[(int)i] = 0.;
		for (j = 0; j < g_matrix.fColumnCount; ++j)
		{
			double		fMatrixReal = g_matrix.pfReal[(int)i*(int)g_matrix.fColumnCount + (int)j];
			double		fMatrixImaginary = g_matrix.pfImaginary[(int)i*(int)g_matrix.fColumnCount + (int)j];
			g_vector_output.pfReal[(int)i] += fMatrixReal * g_vector_input.pfReal[(int)j] - fMatrixImaginary * g_vector_input.pfImaginary[(int)j];
			g_vector_output.pfImaginary[(int)i] += fMatrixReal * g_vector_input.pfImaginary[(int)j] + fMatrixImaginary * g_vector_input.pfReal[(int)j];
		}
	}

	bRtn = true;
	return bRtn;
}
开发者ID:mystous,项目名称:DSLab_Algo_Seminar,代码行数:35,代码来源:20150306_KyuNam_Cho_MVMul_MPI.cpp

示例3: hm_req_handle_fetch_buf_free

void
hm_req_handle_fetch_buf_free (T_REQ_HANDLE * req_handle)
{
  int i, j, fetched_tuple;

  if (req_handle->tuple_value)
    {
      fetched_tuple = req_handle->fetched_tuple_end -
	req_handle->fetched_tuple_begin + 1;
      for (i = 0; i < fetched_tuple; i++)
	{
#if defined(WINDOWS)
	  for (j = 0; j < req_handle->num_col_info; j++)
	    {
	      FREE_MEM (req_handle->tuple_value[i].decoded_ptr[j]);
	    }

	  FREE_MEM (req_handle->tuple_value[i].decoded_ptr);
#endif
	  FREE_MEM (req_handle->tuple_value[i].column_ptr);
	}
      FREE_MEM (req_handle->tuple_value);
    }
  FREE_MEM (req_handle->msg_buf);
  req_handle->fetched_tuple_begin = req_handle->fetched_tuple_end = 0;
  req_handle->cur_fetch_tuple_index = -1;
  req_handle->is_fetch_completed = 0;
}
开发者ID:CUBRID,项目名称:cubrid-cci,代码行数:28,代码来源:cci_handle_mng.c

示例4: query_info_clear

void
query_info_clear (T_QUERY_INFO * qi)
{
  FREE_MEM (qi->sql);
  FREE_MEM (qi->cas_log);
  qi->start_date[0] = '\0';
}
开发者ID:dong1,项目名称:testsize,代码行数:7,代码来源:cas_query_info.c

示例5: GetFocus

*/	int OS_Browse(REBCHR *url, int reserved)
/*
***********************************************************************/
{
	#define MAX_BRW_PATH 2044
	long flag;
	long len;
	long type;
	HKEY key;
	REBCHR *path;
	HWND hWnd = GetFocus();

	if (RegOpenKeyEx(HKEY_CLASSES_ROOT, TEXT("http\\shell\\open\\command"), 0, KEY_READ, &key) != ERROR_SUCCESS)
		return 0;

	if (!url) url = TEXT("");

	path = MAKE_STR(MAX_BRW_PATH+4);
	len = MAX_BRW_PATH;

	flag = RegQueryValueEx(key, TEXT(""), 0, &type, (LPBYTE)path, &len);
	RegCloseKey(key);
	if (flag != ERROR_SUCCESS) {
		FREE_MEM(path);
		return 0;
	}
	//if (ExpandEnvironmentStrings(&str[0], result, len))

	Insert_Command_Arg(path, url, MAX_BRW_PATH);

	len = OS_Create_Process(path, 0);

	FREE_MEM(path);
	return len;
}
开发者ID:RamchandraApte,项目名称:rebol,代码行数:35,代码来源:host-lib.c

示例6: extract_host_partition_stat

static void *
extract_host_partition_stat (FILE * fp, const char *arg1,
			     T_CM_ERROR * err_buf)
{
  char linebuf[LINE_MAX];
  char type[512];
  int nitem = 0;
  int nalloc = 10;
  T_CM_DISK_PARTITION_STAT *p = NULL;
  T_CM_DISK_PARTITION_STAT_ALL *stat = NULL;

  stat =
    (T_CM_DISK_PARTITION_STAT_ALL *)
    malloc (sizeof (T_CM_DISK_PARTITION_STAT_ALL));
  p =
    (T_CM_DISK_PARTITION_STAT *) malloc (nalloc *
					 sizeof (T_CM_DISK_PARTITION_STAT));
  if (stat == NULL || p == NULL)
    {
      cm_set_error (err_buf, CM_OUT_OF_MEMORY);
      FREE_MEM (stat);
      FREE_MEM (p);
      return NULL;
    }
  stat->partitions = p;

  while (fgets (linebuf, sizeof (linebuf), fp))
    {
      sscanf (linebuf, "%*s%511s", type);
      if (strstr (type, "ext") == NULL)
	continue;

      if (nitem >= nalloc)
	{
	  nalloc *= 2;
	  stat->partitions =
	    realloc (stat->partitions,
		     nalloc * sizeof (T_CM_DISK_PARTITION_STAT));
	}
      if (stat->partitions)
	{
	  p = stat->partitions + nitem;
	  sscanf (linebuf, "%255s%*s%llu%llu%llu", p->name, &p->size,
		  &p->used, &p->avail);
	  nitem++;
	}
      else
	{
	  cm_host_disk_partition_stat_free (stat);
	  cm_set_error (err_buf, CM_OUT_OF_MEMORY);
	  return NULL;
	}
    }
  stat->num_stat = nitem;

  return stat;
}
开发者ID:dong1,项目名称:testsize,代码行数:57,代码来源:cm_mem_cpu_stat.c

示例7: cm_db_proc_stat_all_free

void
cm_db_proc_stat_all_free (T_CM_DB_PROC_STAT_ALL * stat)
{
  if (stat != NULL)
    {
      FREE_MEM (stat->db_stats);
      FREE_MEM (stat);
    }
}
开发者ID:dong1,项目名称:testsize,代码行数:9,代码来源:cm_mem_cpu_stat.c

示例8: cm_host_disk_partition_stat_free

void
cm_host_disk_partition_stat_free (T_CM_DISK_PARTITION_STAT_ALL * stat)
{
  if (stat != NULL)
    {
      FREE_MEM (stat->partitions);
      FREE_MEM (stat);
    }
}
开发者ID:dong1,项目名称:testsize,代码行数:9,代码来源:cm_mem_cpu_stat.c

示例9: _T

int CMPIPTV_RTSP::SendRtspCommand(const TCHAR *method, const TCHAR *command, MediaSubsession *subsession)
{
  this->logger.Log(LOGGER_VERBOSE, _T("%s: %s: send %s command"), PROTOCOL_IMPLEMENTATION_NAME, method, command);
  ResetEvent(this->rtspResponseEvent);
  if (_tcscmp(command, _T("OPTIONS")) == 0)
  {
    this->rtspClient->sendOptionsCommand(&CMPIPTV_RTSP::OnRtspResponseReceived);
  }
  else if (_tcscmp(command, _T("DESCRIBE")) == 0)
  {
    this->rtspClient->sendDescribeCommand(&CMPIPTV_RTSP::OnRtspResponseReceived);
  }
  else if (_tcscmp(command, _T("SETUP")) == 0)
  {
    this->rtspClient->sendSetupCommand(*subsession, &CMPIPTV_RTSP::OnRtspResponseReceived);
  }
  else if (_tcscmp(command, _T("PLAY")) == 0)
  {
    this->rtspClient->sendPlayCommand(*this->rtspSession, &CMPIPTV_RTSP::OnRtspResponseReceived);
  }
  else if (_tcscmp(command, _T("TEARDOWN")) == 0)
  {
    this->rtspClient->sendTeardownCommand(*this->rtspSession, &CMPIPTV_RTSP::OnRtspResponseReceived);
  }
  else
  {
    return STATUS_ERROR;
  }

  if (WaitForSingleObject(this->rtspResponseEvent, this->rtspCommandResponseTimeout) == WAIT_TIMEOUT)
  {
    this->logger.Log(LOGGER_ERROR, _T("%s: %s: %s command timed out"), PROTOCOL_IMPLEMENTATION_NAME, method, command);
    return STATUS_ERROR;
  }
  if (this->rtspResponseResultCode != 0)
  {
#ifdef _MBCS
    TCHAR *convertedRtspResponse = ConvertToMultiByteA(&this->rtspResponseResultString[0]);
#else
    TCHAR *convertedRtspResponse = ConvertToUnicodeA(&this->rtspResponseResultString[0]);
#endif
    this->logger.Log(LOGGER_ERROR, _T("%s: %s: %s command failed, code = %i, response = %s"), PROTOCOL_IMPLEMENTATION_NAME, method, command, this->rtspResponseResultCode, (convertedRtspResponse == NULL) ? _T("unable to get message") : convertedRtspResponse);
    FREE_MEM(convertedRtspResponse);
    return STATUS_ERROR;
  }

#ifdef _MBCS
  TCHAR *convertedRtspResponse = ConvertToMultiByteA(&this->rtspResponseResultString[0]);
#else
  TCHAR *convertedRtspResponse = ConvertToUnicodeA(&this->rtspResponseResultString[0]);
#endif
  this->logger.Log(LOGGER_VERBOSE, _T("%s: %s: %s command succeeded, response = %s"), PROTOCOL_IMPLEMENTATION_NAME, method, command, (convertedRtspResponse == NULL) ? _T("unable to get message") : convertedRtspResponse);
  FREE_MEM(convertedRtspResponse);
  return STATUS_OK;
}
开发者ID:Azzuro,项目名称:MediaPortal-1,代码行数:55,代码来源:MPIPTV_RTSP.cpp

示例10: t_set_free

void
t_set_free (T_SET * set)
{
  if (set == NULL)
    return;

  FREE_MEM (set->element);
  FREE_MEM (set->data_buf);
  hm_conv_value_buf_clear (&(set->conv_value_buffer));
  FREE_MEM (set);
}
开发者ID:dong1,项目名称:testsize,代码行数:11,代码来源:cci_t_set.c

示例11: net_decode_str

int
net_decode_str (char *msg, int msg_size, char *func_code, void ***ret_argv)
{
  int remain_size = msg_size;
  char *cur_p = msg;
  char *argp;
  int i_val;
  void **argv = NULL;
  int argc = 0;

  *ret_argv = (void **) NULL;

  if (remain_size < 1)
    return CAS_ER_COMMUNICATION;

  *func_code = *cur_p;
  cur_p += 1;
  remain_size -= 1;

  while (remain_size > 0)
    {
      if (remain_size < 4)
	{
	  FREE_MEM (argv);
	  return CAS_ER_COMMUNICATION;
	}
      argp = cur_p;
      memcpy ((char *) &i_val, cur_p, 4);
      i_val = ntohl (i_val);
      remain_size -= 4;
      cur_p += 4;

      if (remain_size < i_val)
	{
	  FREE_MEM (argv);
	  return CAS_ER_COMMUNICATION;
	}

      argc++;
      argv = (void **) REALLOC (argv, sizeof (void *) * argc);
      if (argv == NULL)
	return CAS_ER_NO_MORE_MEMORY;

      argv[argc - 1] = argp;

      cur_p += i_val;
      remain_size -= i_val;
    }

  *ret_argv = argv;
  return argc;
}
开发者ID:BogdanStroe,项目名称:cubrid,代码行数:52,代码来源:cas_network.c

示例12: t_set_decode

int
t_set_decode (T_SET * set)
{
  void **element;
  char *cur_p;
  int i;
  int remain_size;
  int ele_size;

  if (set->num_element < 0 || set->data_size < 0)
    return CCI_ER_COMMUNICATION;

  if (set->num_element == 0 || set->data_size == 0)
    return 0;

  element = (void **) MALLOC (sizeof (void *) * set->num_element);
  if (element == NULL)
    return CCI_ER_NO_MORE_MEMORY;
  memset (element, 0, sizeof (void *) * set->num_element);

  remain_size = set->data_size;
  cur_p = (char *) set->data_buf;

  for (i = 0; i < set->num_element; i++)
    {
      element[i] = cur_p;
      if (remain_size < 4)
	{
	  FREE_MEM (element);
	  return CCI_ER_COMMUNICATION;
	}
      NET_STR_TO_INT (ele_size, cur_p);
      cur_p += 4;
      remain_size -= 4;

      if (ele_size <= 0)
	continue;

      if (remain_size < ele_size)
	{
	  FREE_MEM (element);
	  return CCI_ER_COMMUNICATION;
	}
      cur_p += ele_size;
      remain_size -= ele_size;
    }

  set->element = element;
  return 0;
}
开发者ID:dong1,项目名称:testsize,代码行数:50,代码来源:cci_t_set.c

示例13: HvlFreeNotification

VOID
HvlFreeNotification(
    PHVL_NOTIFICATION pHvlNotif
    )
{
    if (pHvlNotif)
    {
        if (pHvlNotif->pvNotif)
        {
            FREE_MEM(pHvlNotif->pvNotif);
        }
        
        FREE_MEM(pHvlNotif);
    }
}
开发者ID:Realhram,项目名称:wdk81,代码行数:15,代码来源:hvl_queue.c

示例14: WahDestroyContextTable

DWORD
WINAPI
WahDestroyContextTable(
    LPCONTEXT_TABLE Table
    )

/*++

Routine Description:

    Destroys an existing context table.

Arguments:

    Table - A pointer to the table to destroy.

Return Value:

    DWORD - NO_ERROR if successful, a Win32 error code if not.

--*/

{

    //
    // Delete the context table's critical section if necessary.
    //

    if( Table->Flags & WAH_CONTEXT_FLAG_SERIALIZE ) {

        DeleteCriticalSection( TABLE_TO_LOCK( Table ) );

    }

    //
    // Free the resources.
    //

    FREE_MEM( Table->LookupArray );
    FREE_MEM( Table );

    //
    // Success!
    //

    return NO_ERROR;

}   // WahDestroyContextTable
开发者ID:mingpen,项目名称:OpenNT,代码行数:48,代码来源:context.c

示例15: cm_get_db_exec_stat

int
cm_get_db_exec_stat (const char *db_name,
		     T_CM_DB_EXEC_STAT * exec_stat, T_CM_ERROR * err_buf)
{
  T_CM_DB_EXEC_STAT *p = NULL;
  char *root_env = NULL;
  char exec_path[PATH_MAX];
  /* cubrid statdump dbname */
  const char *argv[] = {
    exec_path,
    "statdump",
    db_name,
    NULL,
  };

  cm_err_buf_reset (err_buf);
  if (db_name == NULL)
    {
      cm_set_error (err_buf, CM_ERR_NULL_POINTER);
      return -1;
    }

  (void) envvar_bindir_file (exec_path, PATH_MAX, UTIL_CUBRID);
  p = (T_CM_DB_EXEC_STAT *) cm_get_command_result (argv,
						   extract_db_exec_stat,
						   db_name, err_buf);
  if (p != NULL)
    {
      *exec_stat = *p;
      FREE_MEM (p);
      return 0;
    }
  return -1;
}
开发者ID:dong1,项目名称:testsize,代码行数:34,代码来源:cm_mem_cpu_stat.c


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