블로그 이미지
kalstein

여러가지 프로그래밍 관련이나...신변잡기적인 글들을 남기는 블로그입니다. 지식은 나누는만큼 강력해집니다 ^^

Rss feed Tistory
Programming 2011. 2. 17. 13:50

gcov 사용방법

gcov는 gcc와 함께 사용되는 code coverage 툴이다.
사용방법을 기재해둔다.

1. 연관된 gcc 옵션 : compile : -g --coverage  / link : -fprofile-arcs
2. 1번의 옵션으로 컴파일 후 실행.
3. gcov -b [소스파일]
4. 소스파일.gov 를 본다.


,
Programming 2011. 2. 16. 15:39

Code coverage with Visual C++ (track-back)

VC++에서 코드커버리지 하는거... 발견한것 링크~


,
Programming 2010. 11. 12. 16:42

C++ RValue Reference... 꽤 괜찮겠네

기존의 C++에서는 복사생성자 및 대입연산자에서는 무조건 deep copy를 해야했다.
예륻 들어 vector<> 같은 녀석이 있었고 그게 사이즈가 크다면 모조리 다 copy부터 했다는뜻.
그러나... RValue Reference의 경우는 Shallow copy만 해도 된다!
(간단히 말해 포인터만 옮겨간다...라고 생각하믄 될듯)

궁금한건...복사생성자,대입연산자는 C++이 기본으로 만들어주는게 있는데,
RValue Reference를 사용하는 move 연산자들은... 자동으루 해주나? ㅡ.ㅡ;;
그건 잘 모르겠네 흠.

뭐 VS 2010 부터 지원된다고 하니 (gcc는 4.0 이상의...뭐 마이너 버젼이 있나본데 자세히는 잘...)
꽤 많은 유저들이 은연중에 사용할듯.
STL 만 해도 그냥 기존처럼 써도 많은 부분이 성능향상이 있으니.
,
Programming 2010. 9. 10. 10:19

DSP에서의 Memory Access (1) - Architecture

Freescale MSC8156 이라는 DSP를 사용중이다.
memory access time이 매우 중요한 이슈라서...Reference Manual을 읽고 좀 정리해본다~

구조는 DCache, M2/L2 memory, M3, DDR 으로 구성되어있다.
(아래 그림 참고)

M3 부터는 DSP Subsystem 을 벗어나, 다른 코어 및 periperal 들과 함께 사용하는 bus에 접근하게 된다. 그러므로, 실제 access time이 매우 오래 걸릴 수 있다.
,
Programming 2010. 6. 29. 23:08

C Structure에서의 this pointer 찾기.

C언어에서 this라니 묘하긴하지만.

struct A
{
   int a, b;
};
가 되어있을때, A 구조체의 b 포인터에서 A 구조체의 포인터를 거슬러 올라가서 구하는? 뭐 그런것.

#define container_of(ptr, type, member) ({   \
const typeof( ((type *)0->member ) * __mptr = (ptr);   \
(type *)( (char *) __mptr - offsetof(type, member) ); } )

길기도 하지 -_-;;;
A structure로 예를 들어보자면, 코드는 다음과 같이 활용될수있다.

void foo (int * b)
{
struct A * p;
p = container_of(b, struct A, b);
}

좀 복잡하긴함...^^;;
,
Programming 2010. 1. 28. 14:28

Memory Marking 하기

사람이 읽기 편하게 마킹하는게....몇가지 있는데

0xDEADBEEF,
0xBADDCAFE,

등등?
,
Programming/WCDMA 2009. 12. 22. 10:50

MAC-ehs와 64QAM의 상관관계

25.306 chapter 5 Possible UE radio access capability parameter settings

에서 찾아볼 수 있다.

 

A UE that supports categories greater or equal to category 13, also supports E-DPDCH.
A UE that supports categories greater or equal to category 13, also supports MAC-ehs.
UEs of categories 13, 15, or 17 also support category 9 when MAC-ehs is configured.
UEs of categories 14, 16, or 18 also support category 10 when MAC-ehs is configured.

 

카테고리 13에서 64QAM 지원시에는 F,Q 테이블을 참고하며, 16QAM 시에는 C,D 테이블을 참고한다.

(여기서 테이블은 CQI table을 의미)

C,D 테이블은 각각 카테고리 9,10 에서 사용되는 테이블이다.


즉, MAC-ehs 라고 bit align 될수있다는 얘기.

,
Programming 2009. 4. 22. 09:47

TortoiseSVN 에서 Merge 하기.

지금까지 쭉 써오면서...주로 혼자만 쓰다보니;;; merge기능은 잘 안썼었다.
(branch를 쓰긴했지만, 그냥 테스트용도로 잠시 쓰고 버렸을뿐;;)
이번에 쓰려고 하니 잘 모르는부분이 많아서 검색 후 좋은 내용을 발견.

그래서 링크걸어둔다.

http://bchavez.bitarmory.com/archive/2008/06/03/quothow-toquot-svn-merge-with-tortoisesvn.aspx
,
Programming 2009. 4. 8. 09:26

Subversion Rollback 하기.

commit을 잘못했을 경우에 대처법. (tortoise SVN)

Subversion doesn’t offer this capability directly, but you can achieve the same results using the merge command. So if you accidently check in some code that you want to then effectively remove from the tree, you can.

svn merge usage has three forms (run svn help merge for the full details) but the one I prefer looks like this:

svn merge -r<from>:<to> <repository> <working directory>

In the wild that translates to something like this (from within your checked-out trunk):

svn merge -r1455:1454 https://prime/svn/client/tfg/aurora2/trunk .

Follow this up with a check in:

svn ci -m "Rolled back to r1454"

Note that it doesn’t remove the broken revision (in the above case, r1455) from the repository. Instead you’ll get a new revision (r1456) which is identical to 1454. It’s still possible though for the broken version to be checked out if you specifies r1455.



요렇게 하면 된다넹~~~
(링크 : http://lambie.org/2008/05/23/rolling-back-your-subversion-repository-to-a-previous-good-revision/)
,
Programming 2009. 3. 10. 17:01

Windows Programming에서 Memory leak 감지

뭐...사실 좋은 툴들 많지만. 그냥 Windows에서 자체 제공하는것으로 체크하는 방법.

#include <stdlib.h>             // STEP 1
#include <crtdbg.h>             // STEP 2

int main()
{
    _CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
    _CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDOUT );
    _CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
    _CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDOUT );
    _CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
    _CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDOUT );
   
    int * p = (int *)malloc(sizeof(int) * 10);
    _CrtDumpMemoryLeaks( );
}

요렇게 종료전에 CrtDumpMemoryLeaks 호출하면 memory leak이 있을경우 알려준다.
(위에서는 STDOUT으로 설정했으니까 콘솔창에 보여진다)
,
TOTAL TODAY