D:\Work\ferrari\src>hg head                               => 현재 헤드 상태를 보여준다. 여기서는 헤드가 2개.
changeset:   3114:be93d2b443a3
parent:      3112:9ed49f67c4a6
user:        youngspapa
date:        Mon Jul 11 19:02:10 2011 +0900
summary:     화살표 코드 변경

changeset:   3099:1ec9b73857d3
user:        youngspapa
date:        Mon Jul 11 18:43:29 2011 +0900
summary:     릭 테스트 중


D:\Work\ferrari\src>hg up -r 3114                        => 리비전 3114로 업데이트 한다.
27 files updated, 0 file merged, 0 file removed, 0 file unresolved
 
D:\Work\ferrari\src>


'Mercurial' 카테고리의 다른 글

특정 브랜치만 푸시하기  (0) 2011.07.11
마지막 커밋된 체인지셋 제거하기  (0) 2011.05.25
브렌치 종료 명령어  (0) 2011.05.25
블로그 이미지

영스파파

3D 세상을 만들기 위한 프로그래밍 정보들을 정리하는 공간

,

D:\Work\ferrari\src>hg head                               => 현재 헤드 상태를 보여준다. 여기서는 헤드가 2개.
changeset:   3114:be93d2b443a3
tag:         tip
parent:      3112:9ed49f67c4a6
user:        youngspapa
date:        Mon Jul 11 19:02:10 2011 +0900
summary:     화살표 코드 변경

changeset:   3099:1ec9b73857d3
user:        youngspapa
date:        Mon Jul 11 18:43:29 2011 +0900
summary:     릭 테스트 중


D:\Work\ferrari\src>hg push -r 3114                    => 리비전 3114 브랜치만 강제로 푸시한다.
pushing to ssh://hg@192.168.0.240/fc2/src
searching for changes
no changes found

D:\Work\ferrari\src>


'Mercurial' 카테고리의 다른 글

특정 리비전으로 업데이트 하기  (0) 2011.07.11
마지막 커밋된 체인지셋 제거하기  (0) 2011.05.25
브렌치 종료 명령어  (0) 2011.05.25
블로그 이미지

영스파파

3D 세상을 만들기 위한 프로그래밍 정보들을 정리하는 공간

,

MemoryLeak.h

#ifndef _MEMORYLEAK_H_  

#define _MEMORYLEAK_H_  

  

#ifdef _DEBUG  

#define _CRTDBG_MAP_ALLOC  

#include <crtdbg.h>  

#define new new(_NORMAL_BLOCK, __FILE__, __LINE__)  

static class MemoryMng  

{  

public:  

    MemoryMng() {   

        _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);  

    }  

    ~MemoryMng() {   

    _ASSERTE( _CrtCheckMemory( ) );  

    }  

  

  

} MemoryLeak;  

#endif      // _DEBUG  

#endif      // _MEMORYLEAK_H_  


CrtDbgRoutine.cpp

#include "stdafx.h"

#include "MemoryLeak.h"


int _tmain(int argc, _TCHAR* argv[])

{

_CrtMemState ms;


for(int i = 0; i < 100; ++i)

{

int* p = new int;

}


//_CrtSetBreakAlloc(202); // 힙에 202번째로 메모리 할당을 요청하는 코드에서 브레이크

_CrtMemCheckpoint(&ms); // ms에 메모리 상태 저장


for(int i = 0; i < 200; ++i)

{

int* p = new int;

}


_CrtMemDumpAllObjectsSince(&ms); // ms에 저장된 메모리와 비교해서 누수된 메모리 리포트

_CrtDbgBreak();


return 0;

}



_CrtMemCheckpoint() 함수부터 _CrtMemDumpAllObjectsSince() 함수가 있는 부분까지 누수된 부분이 다음과 같이 표시된다.

.................................................................
d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {209} normal block at 0x00375D90, 4 bytes long.

 Data: <    > CD CD CD CD 

d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {208} normal block at 0x00375D50, 4 bytes long.

 Data: <    > CD CD CD CD 

d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {207} normal block at 0x00375D10, 4 bytes long.

 Data: <    > CD CD CD CD 

d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {206} normal block at 0x00375CD0, 4 bytes long.

 Data: <    > CD CD CD CD 

d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {205} normal block at 0x00375C90, 4 bytes long.

 Data: <    > CD CD CD CD 

d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {204} normal block at 0x00375C50, 4 bytes long.

 Data: <    > CD CD CD CD 

d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {203} normal block at 0x00375C10, 4 bytes long.

 Data: <    > CD CD CD CD 

d:\work\ogre\crtdbgroutine\crtdbgroutine.cpp(22) : {202} normal block at 0x00375BD0, 4 bytes long.

 Data: <    > CD CD CD CD 

Object dump complete.

CrtDbgRoutine.exe이(가) 중단점을 트리거했습니다.


위의 누수된 부분을 더블클릭하면 그 코드로 이동한다.

블로그 이미지

영스파파

3D 세상을 만들기 위한 프로그래밍 정보들을 정리하는 공간

,