__attribute__ ((pure))

백창우 2008.04.12 18:10 조회 수 : 82290 추천:40

`pure'
     Many functions have no effects except the return value and their
     return value depends only on the parameters and/or global
     variables.  Such a function can be subject to common subexpression
     elimination and loop optimization just as an arithmetic operator
     would be.  These functions should be declared with the attribute
     `pure'.  For example,

          int square (int) __attribute__ ((pure));

     says that the hypothetical function `square' is safe to call fewer
     times than the program says.

     Some of common examples of pure functions are `strlen' or `memcmp'.
     Interesting non-pure functions are functions with infinite loops
     or those depending on volatile memory or other system resource,
     that may change between two consecutive calls (such as `feof' in a
     multithreading environment).

     The attribute `pure' is not implemented in GCC versions earlier
     than 2.96.
번호 제목 글쓴이 날짜 조회 수
공지 [공지] 하이퍼바이져 스터디 관련 Q&A 게시판 입니다. woos 2016.04.09 237
95 저는 CaOS-64bit를 준비해보려구요 [4] 김기오 2008.04.23 4732
94 자동 ctags 만들어주는 스크립트좀 공유해주세요 [2] 박세율 2008.04.20 5424
93 Windows Kernel에서 suspend 문제 [9] 백창우 2008.04.20 6323
92 스터디 현재 진행상황 백창우 2008.04.20 4326
91 [re] 내일 하는 거 맞지요? [3] 장동일 2008.04.18 4354
90 혹시 저에게 연락할일이 있다면. 백창우 2008.04.18 4770
89 Hypervisor Detailed Design (작성중 문서) [3] file 백창우 2008.04.16 12187
88 이번 주 스터디는 쉬는게 어떨런지요? [8] 최창훈 2008.04.15 4657
87 [이번주] 벌금 처리 및 시작 시간 변경 논의 [7] 백창우 2008.04.14 4549
86 Hypervisor 아키텍쳐 디자인 백창우 2008.04.14 11156
85 스프링 노트 주소를 변경하였습니다. [3] 백창우 2008.04.14 4624
84 VMWare 가 공개인가요? [3] 박세율 2008.04.13 4966
» __attribute__ ((pure)) [1] 백창우 2008.04.12 82290
82 요즘 하고 있는일 [3] 정성욱 2008.04.11 4814
81 지각시 벌금 처리건 논의 [14] 백창우 2008.03.31 5271
80 창우씨 책읽고 드디어 vi 설정을 할 수 있었습니다. 김기오 2008.03.31 4515
79 NUMA, ACPI 자료가 뭐가 있을까요? [5] 김기오 2008.03.29 5032
78 콘솔에서도 ecb가 되네요 [1] 김기오 2008.03.28 5239
77 아무래도 vim에서 벋어나기가 힘드네요 [1] 김기오 2008.03.27 5615
76 [re] 성욱씨 emacs 문의요 [2] file 정성욱 2008.03.27 5499
XE Login