亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? memchk.c

?? 此代碼是C編的EWZ的測(cè)試程序,大家可以嘗試對(duì)這個(gè)包里lena.pgm進(jìn)行圖像壓縮處理.
?? C
字號(hào):
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Adapted/reformated to suit my own coding style. Some changes to the 
 * printing. Also the defintion that enable/disable the memory checker.
 * Added a few functions and definitions.
 *
 * Mow-Song, Ng 2/9/2002
 * msng@mmu.edu.my
 * http://www.pesona.mmu.edu.my/~msng
 *
 * I do not claim copyright to the code, but if you use them or modify them,
 * please drop me a mail.
 *
 */
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/* Original code from LiftPack */
/*
 *  -*- Mode: ANSI C -*-
 *  $Id: memchk.c,v 1.7 1996/11/18 18:49:11 fernande Exp $
 *  $Header: /sgi.acct/sweldens/cvs/liftpack/Util/memchk.c,v 1.7 
 *           1996/11/18 18:49:11 fernande Exp $
 *  Author: M. A. Sridhar
 *  Modified: Gabriel Fernandez
 *
 *  This file has a memory leak checker which keeps track of all the
 *  allocations and deallocations in order to see if some previously
 *  allocated memory is not freed at the end of the execution of the
 *  code.
 *  The functions included are malloc, calloc, realloc, and free.
 *
 *  NOTE: It is important tht this program is not combined with any
 *        other memory handler, because a list of allocations and
 *        deallocations is kept with every call to 'malloc', 'calloc',
 *        'realloc', and 'free'. If 'free' is used to deallocate a
 *        memory segment allocated with other function that the ones in
 *        this file, the program will segment fault because is trying to
 *        delete a list entry which does not exists.
 */
/* do not edit anything above this line */

#include <string.h>
#include "memchk.h"

#undef calloc
#undef realloc
#undef malloc
#undef free

#include <malloc.h>
#include <stdio.h>

typedef unsigned long uLong;
typedef unsigned char uChar;

uLong magic_cookie = 0xf9a42bb1; /* Used to indicate "allocated" state */

/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
struct BlockHeader {
    uLong marker;
    long  time;
    struct BlockHeader* prev;
    struct BlockHeader* next;
    char*  file;
    long  lineNo;
    long  size;
#ifdef DOUBLE
    uChar dummy[4];   /* pad structure to a power of two */
#endif
};


/* --------------------- Static variables --------------------------------- */

static struct BlockHeader* _AllocListHead = 0; /* Head of list of */
                                               /* allocated blocks */
static struct BlockHeader* _AllocListTail = 0; /* Tail of list of */
                                               /* allocated blocks */
static short        _LeakCheckerActive = 0;
static long         _Time = 0;          /* Clock: ticks on every new and */
                                        /* delete */

static long         _MaxMem = 0;        /* Max memory used so far */
static long         _CurrentAlloc = 0;  /* Amount of memory currently */
                                        /* allocated */
static long         _BeginTime = 0;     /* Time at which leack checker was */
                                        /* instantiated */
/*------------------------------------------------------------------------- */

/* code */

/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*
 * Calloc function: same as Malloc, but initializes the content with
 *                  zeros.
 */
void *Calloc ( size_t n, size_t s, int line_no, char *file_name )
{
    size_t size = n*s;
    uChar *buffer = (uChar *)Malloc ( size, line_no, file_name );
    int i;

    for ( i=0 ; i<(int)size ; i++ )
        buffer[i] = 0;

    return buffer;
}


/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*
 * Realloc function: reallocates a contiguous segment of memory using
 *                   the same pointer variable.
 */
void *Realloc ( void *p, size_t s, int line_no, char *file_name )
{
    uChar *newp;
    struct BlockHeader* q;
    
    /* Check for integrity of memory in p */
    q = (struct BlockHeader*)
        ( (uChar*) p - sizeof (struct BlockHeader));
    if (q->marker != magic_cookie && _LeakCheckerActive)
        fprintf (stderr, "Realloc(%8lx): memory corrupted", (long)p);

    /* Allocate new segment and copy p into it */
    newp = (uChar *)Malloc ( s, line_no, file_name );
    newp = (uChar *)memcpy (newp, p, (size_t)q->size);

    /* Free p and return new segment */
    Free (p);
    return (void *)newp;
}


/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*
 * Malloc function: uses a linked list to keep track of all the memory
 *                  segments that have been allocated so far. It
 *                  includes information about the size of the segment,
 *                  the file where the allocation was done, the line
 *                  where the function was called, and the order in
 *                  which the call was executed.
 */
void* Malloc (size_t n, int line_no, char* file_name)
{
    struct BlockHeader* q;
    long size;
    uChar* p;

    if (n == 0)
        return NULL;
	
    size = (long)n;
    /* Allocate  extra bytes */
    p = (uChar*) malloc (n + sizeof (struct BlockHeader));
    if (!p) {
        fprintf (stderr, "Malloc(): allocating %u bytes: no memory!", n);
        exit (1);
    }
    
    _CurrentAlloc += (long)n;
    if (_CurrentAlloc > _MaxMem)
        _MaxMem = _CurrentAlloc;
    q = (struct BlockHeader*) p;
    /* Put a magic marker */
    q->marker = magic_cookie;
    q->time   = _Time++;
    q->size   = size;
    q->file   = file_name;
    q->lineNo = (long)line_no;
    memset (p + sizeof(struct BlockHeader),  '\02', (unsigned int) size);
    /* Uninitialized allocated memory has 02 in it */
    
	 /* Insert at tail of allocated list */
    if (_AllocListTail) {
        _AllocListTail->next = q;
        q->prev = _AllocListTail;
        q->next = 0;
        _AllocListTail = q;
    }
    else {
        _AllocListHead = _AllocListTail = q;
        q->prev = q->next = 0;
    }
    return p + sizeof(struct BlockHeader);
}

/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*
 * Free function: frees previously allocated memory and puts 03 in
 *                it to verify later on. The entry in the linked list
 *                is removed and all the other entries are reorganized.
 */
void Free (void* p)
{
    struct BlockHeader* q;
    
    if ( p == NULL )
        fprintf (stderr, "Free(%8lx): empty memory\n", (long)p);
    q = (struct BlockHeader*)
        ( (uChar*) p - sizeof (struct BlockHeader));
    if (q->marker != magic_cookie && _LeakCheckerActive)
        fprintf (stderr, "Free(%8lx): memory corrupted\n", (long)p);

    _CurrentAlloc -= q->size;
    if (_AllocListHead) {
        if (q->prev)
            q->prev->next = q->next;
        if (q->next)
            q->next->prev = q->prev;
        if (q == _AllocListHead)
            _AllocListHead = q->next;
        if (q == _AllocListTail)
            _AllocListTail = q->prev;
        memset (q,  '\03', (unsigned int) (sizeof(struct BlockHeader) +
                                           (unsigned int)q->size));
            /* Freed  memory has 03 in it */
    }
    free (q);
    _Time++;
}


/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*
 * PrintLeaks function: this routine prints the content of the linked
 *                      list with all the information about memory
 *                      allocated so far. If everything that was
 *                      allocated was freed, then the list should be
 *                      empty and nothing should be printed.
*/
int PrintLeaks ()
{

#ifdef __MEMCHK_ENABLE_

	struct BlockHeader* q = _AllocListHead;
	long count = 0;
	
	while (q) {
		if (q->time >= _BeginTime)
			count++;
		q = q->next;
	}
	if (count) {
		fprintf (stderr, "\nMemory status:\n"
			"--------------\n");
		fprintf(stderr, "Max:%d  Current:%d\n", MaxMemory(), CurrentMemoryAllocated());	
	
		q = _AllocListHead;
		while (q) {
			if (q->time >= _BeginTime) {
				/* Only output if the allocation occurred after the leak */
				/* checker was created */
				fprintf (stderr,
					"Time: %ld Address: %08x Size: %ld line %d file '%s'\n",
					q->time, (unsigned long)q, q->size,
					(int)q->lineNo, q->file);
			}
			q = q->next;
		}
		return 1;
	}
	else{
		//fprintf(stderr, "No allocated memory.\n");
		return 0;
	}

#else

	return 0;

#endif

}


/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*
 * FreeLeaks functions: frees intermediate allocated memory that cannot
 *                      be free'd by any other mean since an unexpected
 *                      error has occurred.
*/
void FreeLeaks ()
{

#ifdef __MEMCHK_ENABLE_
	struct BlockHeader* q   = _AllocListHead;
	struct BlockHeader* tmp;
	long count = 0;
	while (q) {
		if (q->time >= _BeginTime)
			count++;
		q = q->next;
	}
	if (count) {
		q = _AllocListHead;
		while (q) {
			tmp = q->next;
			if (q->time >= _BeginTime) {
				/* Only free if the allocation occurred after the leak */
				/* checker was created */
				free (q);
			}
			q = tmp;
		}
	}
	_AllocListHead = _AllocListTail = 0;
	_CurrentAlloc = 0;
#endif

}


/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*
 * MaxMemory functions: returns the maximum memory used so far. 
 *
 */
long MaxMemory()
{
#ifdef __MEMCHK_ENABLE_
	return _MaxMem;
#else
	return 0;
#endif
}

/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/
/*
 * MaxMemory functions: returns the maximum memory used so far. 
 *
 */
long CurrentMemoryAllocated()
{
#ifdef __MEMCHK_ENABLE_
	return _CurrentAlloc;
#else
	return 0;
#endif
}
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产丝袜美腿一区二区三区| 国产精品久久久久久久岛一牛影视 | 精品免费日韩av| 粉嫩高潮美女一区二区三区| 午夜av区久久| 亚洲欧洲色图综合| 精品国产电影一区二区| 欧美性生活久久| 成人免费黄色在线| 琪琪久久久久日韩精品| 玉足女爽爽91| 国产精品久久国产精麻豆99网站| 欧美一区二区三区四区高清| 一本大道久久a久久精二百 | 国产成人免费视频网站| 亚洲另类色综合网站| 久久亚洲综合色| 91精品国产综合久久精品性色| 91丝袜美腿高跟国产极品老师| 黄色精品一二区| 免费成人av在线播放| 亚洲一区二区三区视频在线 | 秋霞电影一区二区| 亚洲午夜在线视频| 亚洲视频一区二区免费在线观看| 国产日产欧产精品推荐色| 日韩三级视频在线观看| 欧美日本一区二区| 91美女片黄在线观看| 国产成人av一区二区三区在线| 卡一卡二国产精品| 日韩高清不卡一区二区三区| 亚洲国产色一区| 亚洲一区免费观看| 亚洲一区二区三区美女| 亚洲男人的天堂一区二区| 国产精品三级av| 久久精品一区二区三区四区| 久久久精品影视| 久久美女高清视频| 久久免费电影网| 久久精子c满五个校花| 26uuu亚洲| 久久久99久久精品欧美| 欧美大尺度电影在线| 欧美一级xxx| 精品欧美乱码久久久久久| 7777精品伊人久久久大香线蕉经典版下载 | 成人精品一区二区三区中文字幕| 韩国三级在线一区| 国产福利91精品| 丰满少妇在线播放bd日韩电影| 成人午夜免费电影| 99精品国产热久久91蜜凸| 91视频免费播放| 欧美色图天堂网| 欧美精品一二三| 欧美不卡视频一区| 久久久久久99久久久精品网站| 久久久国产综合精品女国产盗摄| 久久久国产精华| 中文字幕一区二区在线观看 | 国产精品无遮挡| 亚洲天堂精品在线观看| 亚洲欧美一区二区三区久本道91 | 免费久久精品视频| 狠狠色丁香婷婷综合| 国产aⅴ综合色| 91免费在线视频观看| 欧美日韩午夜在线视频| 欧美成人精品3d动漫h| 国产人久久人人人人爽| 亚洲精品你懂的| 奇米777欧美一区二区| 国产乱人伦偷精品视频不卡| www.一区二区| 欧美精品一卡二卡| 国产欧美精品在线观看| 亚洲自拍偷拍图区| 紧缚奴在线一区二区三区| 国产成人精品免费视频网站| 欧美综合一区二区| 日韩精品一区国产麻豆| 中文字幕中文在线不卡住| 天天综合色天天综合| 国产成人综合在线| 欧美三级中文字幕| 国产日本亚洲高清| 日韩精品1区2区3区| 成人免费观看av| 91精品国产综合久久久久久久| 国产精品青草久久| 免费日韩伦理电影| 91香蕉视频mp4| 欧美精品一区视频| 亚洲一区二区精品3399| 国产精品一区二区在线看| 欧美系列在线观看| 国产精品色噜噜| 久久99国产精品麻豆| 色美美综合视频| 日本一区二区三区在线观看| 午夜精品爽啪视频| av成人老司机| 久久久美女毛片| 视频一区二区国产| 91亚洲国产成人精品一区二三| 精品播放一区二区| 日一区二区三区| 一本一本久久a久久精品综合麻豆| 久久免费视频色| 男男视频亚洲欧美| 欧美性做爰猛烈叫床潮| 国产精品免费丝袜| 国模无码大尺度一区二区三区| 正在播放亚洲一区| 亚洲一区在线电影| 色88888久久久久久影院野外 | 欧美成人一区二区| 亚洲大片免费看| 91视频观看免费| 国产精品卡一卡二| 欧美色精品天天在线观看视频| 国产精品伦理在线| 国产成人综合网站| 久久青草国产手机看片福利盒子 | 91亚洲精品久久久蜜桃| 日本一区二区三区高清不卡| 毛片av一区二区| 777欧美精品| 日本91福利区| 欧美高清www午色夜在线视频| 亚洲午夜久久久久久久久久久| av福利精品导航| 亚洲人成在线观看一区二区| 不卡一区二区中文字幕| 欧美韩国日本不卡| 粗大黑人巨茎大战欧美成人| 国产亚洲欧洲一区高清在线观看| 国产一区免费电影| 久久综合久久综合久久综合| 国产精品一区二区三区乱码| 精品少妇一区二区三区在线播放 | 精品国产乱码久久| 美女视频黄 久久| 精品福利av导航| 国产成人av电影免费在线观看| 国产日韩高清在线| 99re在线视频这里只有精品| 亚洲视频在线一区| 欧美调教femdomvk| 日韩精品高清不卡| 精品国产免费一区二区三区四区| 伦理电影国产精品| 国产日韩在线不卡| 91影院在线观看| 亚洲一区免费视频| 日韩一区二区三区免费观看| 国产在线观看一区二区| 国产女人18毛片水真多成人如厕 | 国产精品一区二区果冻传媒| 日本一区二区三区电影| 91视频com| 日本欧美一区二区三区| xfplay精品久久| 国产成人精品网址| 亚洲男人都懂的| 日韩视频在线一区二区| 国产乱码精品一品二品| 国产精品美日韩| 精品视频资源站| 黄页网站大全一区二区| 亚洲少妇30p| 91精品国产欧美一区二区18| 国产裸体歌舞团一区二区| 中文字幕中文字幕一区二区| 欧美肥胖老妇做爰| 黄色日韩三级电影| 国产一区91精品张津瑜| 亚洲特级片在线| 日韩午夜在线影院| 国产成人亚洲精品狼色在线| 一区二区三区在线高清| 日韩丝袜情趣美女图片| av爱爱亚洲一区| 日本成人在线视频网站| 日本一区二区高清| 欧美日韩高清在线| 成人午夜电影小说| 日韩电影网1区2区| 国产精品色哟哟| 日韩精品一区二区三区在线观看 | 日本最新不卡在线| 国产精品视频观看| 欧美一区二区三区在线观看| 99久久精品国产精品久久| 日韩av在线发布| 亚洲日本va午夜在线电影| 欧美成人精品3d动漫h| 欧美伊人久久大香线蕉综合69|