본문 바로가기
728x90

전체278

register와 volatile 키워드의 역할 register와 volatile 키워드는 해당 변수의 메모리 적재와 관련되어 있으며, 어떤 의미에서는 상반된 역할을 수행하도록 컴파일러에 지시합니다. register 키워드 일반적인 변수선언의 형태처럼 아래와 같이 선언했다면, int i; 해당 변수가 전역 변수로 선언된 경우에는 프로그램의 데이터 영역에, 지역 변수로 선언된 경우에는 스택 영역에 변수의 위치가 할당됩니다. 지역 변수가 스택 영역에 할당되는건, 해당 언어의 스펙과 구현에 따라 다를 수 있습니다. 대개의 경우 재귀호출을 허용하는 언어인 경우에는 스택 영역에, 그렇지 않은 언어의 경우에는 데이터 영역에 지역 변수를 할당하게 됩니다. 조금 말이 길었지만 결국 메모리 어딘가에 전역 변수든 지역변수든 할당된다는 것입니다. 예를 들어 아래와 같은 .. 2002. 12. 4.
volatile Volatile By Nigel Jones Embedded Systems Programming (07/02/01, 12:20:57 PM EDT) The use of volatile is poorly understood by many programmers. This is not surprising, as most C texts dismiss it in a sentence or two. Have you experienced any of the following in your C/C++ embedded code? Code that works fine-until you turn optimization on Code that works fine-as long as interrupts are disabled Fla.. 2002. 12. 4.
What Is Alignment What Is Alignment? Simple data types declared as variables are assigned addresses that are multiples of the size (in bytes) of the data type. Thus, variables of type long will be assigned addresses that are multiples of 4 (the bottom 2 bits of the address are 0). Structures are padded so that each element of the structure will end up at a naturally aligned address. For example:struct x_ { char a.. 2002. 12. 4.
커널에서 double형의 연산이 가능한가요? 출처 : http://linuxkernel.net 게시판 -------------------------------------------------------------------------------- 2002/09/19 (16:35) from 211.38.3.65' of 211.38.3.65' Article Number : 5920 정지호 Access : 18 , Lines : 31 커널에서 double형의 연산이 가능한가요? 혹시 시도해 보신분 안계세요? 커널 소스에서 double형을 사용한곳을 찾아 보니깐.. 드라이버 쪽에서 몇개가 나오고 나머지는 없더군요... 아래 코드의 수행 결과가 이상합니다. ============================================= double dd .. 2002. 12. 4.
728x90