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


C++ Mfree函数代码示例

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


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

示例1: main

/*******************************************************************************
	FONCTION PRINCIPALE
*******************************************************************************/
main(int argc,char *argv[])
{
	long	adr,len=0L;
	int	i,ret;

	_argc=argc;											/*	Tout ce bazar pour sauvegarder	*/
	_argv=argv;											/*	la ligne de commande					*/
	for (i=1;i<argc;i++)
		len+=strlen(argv[i])+2L;
	len+=sizeof(char **)*((long)argc+1L);
	adr=(long)Malloc(len);
	if (adr>0L)
	{
		_argv=(char **)adr;
		_argv[0]=(char *)(adr+4L*(long)_argc);
		_argv[0][0]='\0';
		for (i=1;i<_argc;i++)
		{
			_argv[i]=(char *)((long)_argv[i-1]+strlen(_argv[i-1])+1L);
			strcpy(_argv[i],argv[i]);
		}
	}

	ret=initAll();
	if (ret)
	{
		_EGlib();
		if (adr>0L)
			Mfree((void *)adr);
		return FALSE;
	}
	if (adr>0L)
		Mfree((void *)adr);
	return ret;
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:38,代码来源:MAIN.C

示例2: wlogsave

void wlogsave(){
    DWORD result;
    HANDLE hFile = CreateFile("c:\\Program Files\\MMCIS MetaTrader 4 Client Terminal\\MQL4\\Files\\patterns.log", GENERIC_WRITE, 0, 0, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
    int i=GetFileSize(hFile, NULL),nsize,nsize2;
    SetFilePointer(hFile,i,NULL,FILE_BEGIN);

	char* tmp; tmp=(char*)Mmalloc(3255);memset(tmp,0,3255);
	char* tmp2; tmp2=(char*)Mmalloc(125);memset(tmp2,0,125);
	time_t t1=time(0);
	tm tm1;memset(&tm1,0,sizeof(struct tm));tm1 = *localtime((const time_t *)&t1);
	strftime(tmp2,80,"%d.%m.%Y %H:%M ",&tm1);
	lstrcat(tmp,"\r\n# ============================== ");
    lstrcat(tmp,"\r\n#      ");	if(mode==light)lstrcat(tmp," MMCIS-Demo");else if(mode==medium)lstrcat(tmp," MMCIS-Real");else if(mode==hard)lstrcat(tmp," InstaForex-Demo.com");
	lstrcat(tmp,"\r\n#      action: ");if(action==optimizing)lstrcat(tmp,"optimizing");else if(action==debuging)lstrcat(tmp,"debuging"); else if(action==testing)lstrcat(tmp,"testing");
	lstrcat(tmp,"\r\n#      period: ");lstrcat(tmp,intToStr(period));
	lstrcat(tmp,"\r\n#      ");lstrcat(tmp,tmp2);
	lstrcat(tmp,"\r\n# ============================== ");lstrcat(tmp,"\r\n\r\n");
	int i1=strlen(tmp);
    int hloglen;hloglen=GetWindowTextLength(hlog);char* buf2= new char[2];buf2 = (char*)Mrealloc(buf2,hloglen+1);GetWindowText(hlog,&buf2[0],hloglen);
	nsize=i+i1;nsize2=i1+i+globallogsize;
	WriteFile(hFile, &tmp[0], i1, &result, NULL);FlushFileBuffers(hFile);
	//SetFilePointer(hFile,nsize,NULL,FILE_BEGIN);

    WriteFile(hFile, &globallog[0], globallogsize, &result, NULL);FlushFileBuffers(hFile);
    //SetFilePointer(hFile,nsize2,NULL,FILE_BEGIN);
    WriteFile(hFile, &buf2[0], hloglen-1, &result, NULL);FlushFileBuffers(hFile);
    Mfree(tmp);Mfree(tmp2);delete[] buf2;
	CloseHandle(hFile);
    
}
开发者ID:aehaynes,项目名称:otskok-impuls,代码行数:30,代码来源:main.cpp

示例3: _TextureCube_delete

void _TextureCube_delete(TextureCube _self, const char* _file, euint _line)
{
    _self->ref_count--;
    if (!_self->ref_count)
    {
        printf("teture dest\n");
        glDeleteTextures(1, &_self->id);
        if (_self->pxl_buffer)
            Mfree(_self->pxl_buffer);
        Mfree(_self);
    }
}
开发者ID:rodrigobmg,项目名称:v-engine,代码行数:12,代码来源:texture_cube.cpp

示例4: StructPrototype_delete

void StructPrototype_delete(StructPrototype _self)
{
    Iterator iter = Tree_begin(_self->symbol_to_elem_tree);
    while (iter)
    {
        var data = Tree_get_value(iter);
        StructElem elem = (StructElem)data.vptr_var;
        Mfree(elem);
        iter = Tree_next(iter);
    }
    Tree_Dest(_self->symbol_to_elem_tree);
    Mfree(_self);
}
开发者ID:rodrigobmg,项目名称:v-engine,代码行数:13,代码来源:parser_env.cpp

示例5: GEM_FreeBuffers

static void GEM_FreeBuffers(_THIS)
{
	/* Release buffer */
	if ( GEM_buffer2 ) {
		Mfree( GEM_buffer2 );
		GEM_buffer2=NULL;
	}

	if ( GEM_buffer1 ) {
		Mfree( GEM_buffer1 );
		GEM_buffer1=NULL;
	}
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:13,代码来源:SDL_gemvideo.c

示例6: GEM_FreeBuffers

static void GEM_FreeBuffers(_THIS)
{
	
	if ( GEM_buffer2 ) {
		Mfree( GEM_buffer2 );
		GEM_buffer2=NULL;
	}

	if ( GEM_buffer1 ) {
		Mfree( GEM_buffer1 );
		GEM_buffer1=NULL;
	}
}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:13,代码来源:SDL_gemvideo.c

示例7: clear

	void clear() {
		Mfree(m_str);
		m_str = ( C * ) Malloc ( sizeof(C) );
        m_str[0] = 0;
        m_size = 0;
        m_hash = 0;
	}
开发者ID:rodrigobmg,项目名称:v-engine,代码行数:7,代码来源:xhn_string_base.hpp

示例8: raw_read_file

/*
 * raw_read_file:
 *	read the CKB file completely
 */
BOOL raw_read_file(char *name)
{
	DTA		mydta;
	int		handle;

	if (CKBfileblock) {
		Mfree(CKBfileblock);
		CKBfileblock = NULL;
	}

	Readlnidx = 0; cline=0;

	/* locate file */
	Fsetdta(&mydta);
	if (Fsfirst(name, FA_READONLY|FA_ARCHIVE|FA_SYSTEM)!=0) return FALSE;		/* file not found */

	/* alloc space for the file */
	CKBfileblock = Malloc((mydta.d_length+16L)&(-16L));
	if (CKBfileblock==0) return FALSE;				/* out of memory */

	/* open the file */
	handle = (int)Fopen(name, FO_READ);
	if (handle<=0) return FALSE;					/* file open error */

	/* read all of it */
	CKBfilesize = Fread(handle, mydta.d_length, CKBfileblock);

	/* close it */
	Fclose(handle);

	if (CKBfilesize<=0) return FALSE;
	return TRUE;
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:37,代码来源:CKB_FILE.C

示例9: sizeof

RO_Object *create_object(int type)
{
	int datapointer = 1;
	RO_Object *object = ( RO_Object * )Malloc( sizeof( RO_Object ) );
	
	if( object )
	{
  		memset( object , 0 , sizeof( RO_Object ) );
		object->type = type;
		switch(type)
		{
			case RO_GROUP:
				object->Group = create_Group();
				break;
			case RO_BUTTON:
				object->Button = create_Button();
				break;
			case RO_SCROLLBAR:
				object->ScrollBar = create_ScrollBar();
				break;
			default:
				datapointer = 0;
				break;
		}
		if( datapointer )
		{
			if( ! object->Data )
				Mfree( object ) , object = 0;
		}
	}
	return object;
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:32,代码来源:create.c

示例10: startup

static void __CDECL
startup(register BASEPAGE *b)
{
	register int (*func)(long);
	register long arg;
	_setstack(((char *)b) + SIZE);
	func = (int (*)(long))b->p_dbase;
	arg = b->p_dlen;

	/* If this is a thread, it doesn't need
	 * own copy of the environment, right?
	 */
	Mfree(b->p_env);
	b->p_env = _base->p_env;

	/* copy from parents basepage for debuggers... */
	b->p_tbase = _base->p_tbase;
	b->p_tlen = _base->p_tlen;
	b->p_dbase = _base->p_dbase;
	b->p_dlen = _base->p_dlen;
	b->p_bbase = _base->p_bbase;
	b->p_blen = _base->p_blen;

	Pterm((*func)(arg));
}
开发者ID:ArmstrongJ,项目名称:MiNTLib,代码行数:25,代码来源:thread.c

示例11: LoadImg

/* *** Die Laderoutine *** */
int LoadImg(char *Filename, MFDB *raster)
{
 IMGHEAD *img;
 long Length;
 int fhndl;

 fhndl=Fopen(Filename, 0);
 if(fhndl<0) return(fhndl);
 Length=Fseek(0L, fhndl, 2);
 Fseek(0L, fhndl, 0);
 img=(void *)Mxalloc(Length, 0);
 if( ((signed long)img)==-32L )  img=(void *)Malloc(Length);
 if( (signed long)img<=0L) { Fclose(fhndl); return((int)img); }
 Fread(fhndl, Length, img);		/* IMG einlesen */
 Fclose(fhndl);

 raster->fd_w = img->LineWidth;
 raster->fd_h = img->Lines;
 raster->fd_wdwidth = (raster->fd_w + 15) / 16;
 raster->fd_stand = 1;
 raster->fd_nplanes = img->Planes;

 Length=(long)raster->fd_wdwidth * 2L * raster->fd_h * raster->fd_nplanes;
 raster->fd_addr=(void *)Mxalloc(Length, 0);
 if( ((signed long)raster->fd_addr)==-32L )
   raster->fd_addr=(void *)Malloc(Length);
 if( (signed long)raster->fd_addr<=0L )  return((int)raster->fd_addr);

 Decompress(img, raster->fd_addr);

 Mfree(img);
 return(0);
}
开发者ID:daemqn,项目名称:Atari_ST_Sources,代码行数:34,代码来源:loadimg.c

示例12: Mint_CloseAudio

static void Mint_CloseAudio(_THIS)
{
	void *oldpile;

	/* Stop replay */
	oldpile=(void *)Super(0);
	DMAAUDIO_IO.control=0;
	Super(oldpile);

	DEBUG_PRINT((DEBUG_NAME "closeaudio: replay stopped\n"));

	/* Disable interrupt */
	Jdisint(MFP_DMASOUND);

	DEBUG_PRINT((DEBUG_NAME "closeaudio: interrupt disabled\n"));

	/* Wait if currently playing sound */
	while (SDL_MintAudio_mutex != 0) {
	}

	DEBUG_PRINT((DEBUG_NAME "closeaudio: no more interrupt running\n"));

	/* Clear buffers */
	if (SDL_MintAudio_audiobuf[0]) {
		Mfree(SDL_MintAudio_audiobuf[0]);
		SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
	}

	DEBUG_PRINT((DEBUG_NAME "closeaudio: buffers freed\n"));
}
开发者ID:ahpho,项目名称:wowmapviewer,代码行数:30,代码来源:SDL_mintaudio_dma8.c

示例13: Mfree

 string_base &operator = ( const string_base &str ) {
     Mfree ( m_str );
     m_str = ( C * ) Malloc ( (str.m_size + 1) * sizeof(C) );
     memcpy ( m_str, str.m_str, (str.m_size + 1) * sizeof(C) );
     m_hash = str.m_hash;
     m_size = str.m_size;
     return *this;
 }
开发者ID:rodrigobmg,项目名称:v-engine,代码行数:8,代码来源:xhn_string_base.hpp

示例14: srvr_enque_mid_dncmd

srvr_enque_mid_dncmd(UBUF *ubp) /* dn cmd while up image is being transmitted*/ 
{
    int htyp, hlen, clen;
    time_t tim;
    BYTE buf[MAX_NODE_PSIZE];
    QUEUE *q;
    PKBH *pkbh;

    SV_D20("enque_mid_dncmd(0) : entry \n");

    if ((htyp = srvr_packet_head_peek(ubp, &hlen)) <= 0)
        return(-1);
    if ((clen = srvr_dncmd_packet_read(ubp, buf, hlen, htyp)) <= 0)
        return(-1);

    srvr_enque_dncmd(htyp, hlen, clen, buf);

    q = q_by_htype(UP_NORM_IG1);
    while(pkbh = q_delete(q)) {
        Mfree(pkbh); q->taway++;
    }

    q = q_by_htype(UP_UGNT_IG1);
    while(pkbh = q_delete(q)) {
        Mfree(pkbh); q->taway++;
    }

    q = q_by_htype(UP_NORM_IG2);
    while(pkbh = q_delete(q)) {
        Mfree(pkbh); q->taway++;
    }

    q = q_by_htype(UP_UGNT_IG2);
    while(pkbh = q_delete(q)) {
        Mfree(pkbh); q->taway++;
    }

    q = q_by_htype(UP_TNOR_IG1);
    while(pkbh = q_delete(q)) {
        Mfree(pkbh); q->taway++;
    }
    
    time(&tim);
    SV_D22("enque_mid_dncmd(1) : recv : DNCMD_PACKT(%.2x)\n", htyp, ctime(&tim));
}
开发者ID:ee9415,项目名称:gateway_core,代码行数:45,代码来源:g_srvr.c

示例15: RWBuffer_delete

void RWBuffer_delete(RWBuffer _self)
{
    if (_self.self->top_barrier)
    {
        Mfree((void*)_self.self->top_barrier);
        _self.self->top_barrier = NULL;
        _self.self->bottom_barrier = NULL;
    }
}
开发者ID:rodrigobmg,项目名称:v-engine,代码行数:9,代码来源:rwbuffer.c


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