콜 스택

상향 축적 스택의 콜 스택 레이아웃.

콜 스택(call stack)이란 컴퓨터 프로그램에서 현재 실행 중인 서브루틴에 관한 정보를 저장하는 스택 자료구조이다. 또한 실행 스택(execution stack), 제어 스택 (control stack), 런 타임 스택 (run-time) 스택 혹은 기계 스택 (machine stack) 이라고도 하며, 그냥 줄여서 스택 (the stack) 이라고도 한다. 소프트웨어 프로그램의 기능 수행에 있어 콜 스택의 관리가 중요함에도 불구하고, 상세한 구현은 고급 프로그래밍 언어에서는 보통 감추어지며 자동화되어 있다. 많은 컴퓨터들이 스택 관리를 위한 특별한 명령어(기계어)를 제공하고 있다.

콜 스택을 사용하는 목적은 여러 가지이지만, 주된 이유는 현재 실행 중인 서브루틴의 실행이 끝났을 때, 제어를 반환할 지점을 보관하기 위해서이다. 실행 중인 서브루틴은 호출되어서 그 실행이 아직 완료되지는 않았지만, 완료 후에는 호출된 지점으로 제어를 넘겨야 한다. 서브루틴의 이러한 실행은 여러 단계로 중첩될 수도 있는데, 다른 호출에 의해 또 다른 서브루틴으로 넘어가버리거나, 재귀같은 특별한 경우가 있다. 이러한 중첩의 특성 때문에 스택 자료구조를 사용하는 것이다. 예를 들어 만약 DrawSqure 라는 서브루틴이 있고 DrawSquare 가 DrawLine을 호출한다고 해보자. (Square는 Line 4개니까 4번 호출하게 될 것이다.) DrawLine 서브루틴은 자신이 호출된 뒤 어디로 돌아가야할지 알고 있어야만 한다. (그래야 4번만 불릴 것이다.) 이를 구현하기 위해, 메모리 주소가 서브루틴이 끝날 때 반환 주소(return address)를 확인하도록 하고, 이를 위해 서브루틴 호출시 콜 스택에 반환 주소를 제일 먼저 집어넣는다.

같이 보기

외부 링크

Read other articles:

  لمعانٍ أخرى، طالع دير كريك (توضيح). دير كريك   الإحداثيات 40°37′45″N 89°19′54″W / 40.6292°N 89.3317°W / 40.6292; -89.3317  [1] تقسيم إداري  البلد الولايات المتحدة[2]  التقسيم الأعلى مقاطعة وودفورد  خصائص جغرافية  المساحة 0.57 ميل مربع  ارتفاع 758 قدم  عدد...

 

German heavy bomber during WW2 He 177 Greif The second He 177A-0 production prototype (A-02) with broad-bladed propellers, bearing radio code DL+AQ[1] Role Long-range heavy bomberType of aircraft Manufacturer Heinkel FlugzeugwerkeLicensed to Arado First flight 19 November 1939[2] Introduction 1942 Retired 1945 Primary user Luftwaffe Number built 1,169[3] Variants Heinkel He 274Heinkel He 277 The Heinkel He 177 Greif (Griffin) was a long-range heavy bomber flown by...

 

2013 studio album by Tedeschi Trucks BandMade Up MindStudio album by Tedeschi Trucks BandReleasedAugust 20, 2013 (2013-08-20)StudioSwamp Raga Studios (Jacksonville, Florida)Genre Rock R&B soul Length53:14LabelMasterworksProducer Jim Scott Derek Trucks Tedeschi Trucks Band chronology Everybody's Talkin'(2012) Made Up Mind(2013) Let Me Get By(2016) Professional ratingsAggregate scoresSourceRatingMetacritic76/100[1]Review scoresSourceRatingAmerican Songwriter&#...

Disambiguazione – Se stai cercando il comune ceco del distretto di Kladno, vedi Žilina (Repubblica Ceca). Questa voce sull'argomento centri abitati della Slovacchia è solo un abbozzo. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. Segui i suggerimenti del progetto di riferimento. Žilinacittà Žilina – VedutaIn alto: la cattedrale della Santissima Trinità, Le case borghesi in Piazza Mariánske. Al centro: Una vista interna della chiesa di Santo Stefano, un patri...

 

Election for the governorship of the U.S. state of Mississippi 1873 Mississippi gubernatorial election ← 1869 November 4, 1873 1877 →   Nominee Adelbert Ames James L. Alcorn Party Republican Liberal Republican Popular vote 73,324 52,857 Percentage 58.11% 41.89% County resultsAmes:      50–60%      60–70%      70–80%      80–90%     ...

 

Questa voce sugli argomenti dipartimenti della Francia e Bretagna è solo un abbozzo. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. Finistèredipartimento LocalizzazioneStato Francia Regione Bretagna AmministrazioneCapoluogoQuimper Presidente del Consiglio dipartimentaleNathalie Sarrabezolles (PS) Data di istituzione4 marzo 1790 TerritorioCoordinatedel capoluogo47°59′48″N 4°05′47″W / 47.996667°N 4.096389°W47.996667; -4.096389...

2016年美國總統選舉 ← 2012 2016年11月8日 2020 → 538個選舉人團席位獲勝需270票民意調查投票率55.7%[1][2] ▲ 0.8 %   获提名人 唐納·川普 希拉莉·克林頓 政党 共和黨 民主党 家鄉州 紐約州 紐約州 竞选搭档 迈克·彭斯 蒂姆·凱恩 选举人票 304[3][4][註 1] 227[5] 胜出州/省 30 + 緬-2 20 + DC 民選得票 62,984,828[6] 65,853,514[6]...

 

土库曼斯坦总统土库曼斯坦国徽土库曼斯坦总统旗現任谢尔达尔·别尔德穆哈梅多夫自2022年3月19日官邸阿什哈巴德总统府(Oguzkhan Presidential Palace)機關所在地阿什哈巴德任命者直接选举任期7年,可连选连任首任萨帕尔穆拉特·尼亚佐夫设立1991年10月27日 土库曼斯坦土库曼斯坦政府与政治 国家政府 土库曼斯坦宪法 国旗 国徽 国歌 立法機關(英语:National Council of Turkmenistan) ...

 

A household hazardous waste collection center in Seattle, Washington, U.S. Under United States environmental policy, hazardous waste is a waste (usually a solid waste) that has the potential to: cause, or significantly contribute to an increase in mortality or an increase in serious irreversible, or incapacitating reversible illness; or pose a substantial present or potential hazard to human health or the environment when improperly treated, stored, transported, or disposed of, or otherwise ...

Suburb of West London This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Isleworth – news · newspapers · books · scholar · JSTOR (January 2017) (Learn how and when to remove this message) Human settlement in EnglandIsleworthChurch Street in Isleworth, seen fromacross the River ThamesIsleworthLocation within Gre...

 

2008 Deutsche Tourenwagen Masters Drivers' Champion:Timo ScheiderTeams' Champion:HWA Team I Previous 2007 Next 2009 Support series:Formula 3 Euro Series Timo Scheider won his first Deutsche Tourenwagen Masters Drivers' Championship while Paul di Resta (right) finished second in the championship. The 2008 Deutsche Tourenwagen Masters was the twenty-second season of premier German touring car championship and also ninth season under the moniker of Deutsche Tourenwagen Masters since the series'...

 

British political party For other uses, see Independent Labour Party (disambiguation). Independent Labour Party AbbreviationILPFounderKeir HardieFounded1893Dissolved1975Preceded byScottish Labour Party Bloomsbury Socialist Society Scottish United Trades Councils Labour PartyMerged intoLabour PartySucceeded byIndependent Labour Publications (pressure group inside the Labour Party)HeadquartersMentmore Terrace, London (till 1964)NewspaperLabour LeaderIdeology Democratic socialism ...

Armed wing of the Communist Party of the Philippines This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article relies excessively on references to primary sources. Please improve this article by adding secondary or tertiary sources. Find sources: New People's Army – news · newspapers · books · scholar · JSTOR (February 2021) (Learn how and when ...

 

National handball team FranceInformationNicknameLes Bleues (The Blues)AssociationFrench Handball FederationCoachOlivier KrumbholzAssistant coachSébastien GardillouCaptainEstelle Nze MinkoMost capsIsabelle Wendling (338)Most goalsVéronique Pecqueux-Rolland (898)Colours 1st 2nd ResultsSummer OlympicsAppearances5 (First in 2000)Best result 1st (2020)World ChampionshipAppearances16 (First in 1986)Best result 1st (2003, 2017, 2023)European ChampionshipAppearances12 (First in 2000)Best result 1s...

 

Генеральная прокуратура Союза Советских Социалистических Республиксокращённо: Генпрокуратура СССР Общая информация Страна СССР Дата создания 1933 Предшественник Прокуратура Верховного суда СССР Дата упразднения 29 января 1992 Заменено на Прокуратура Российской Федерац�...

Italian physician Scipione Riva-Rocci Place of birth Riva-Rocci Scipione Riva Rocci (7 August 1863 in Almese, Piedmont – 15 March 1937 in Rapallo, Liguria) was an Italian internist, pathologist and pediatrician. He is best known for the invention of an easy-to-use cuff-based version of the mercury sphygmomanometer for the measurement of blood pressure. Biography Riva Rocci was born on 7 August in Almese in 1863. He graduated in medicine and surgery in 1888 from the University of Turin.&...

 

Glacier in Nunavut, Canada Kaparoqtalik Glacier in the southern Byam Martin Mountains Tip of the tongue of Kaparoqtalik Glacier Kaparoqtalik Glacier is a glacier located in the southern coast of the Byam Martin Mountains on Bylot Island, Nunavut, Canada.[1] It lies in Sirmilik National Park. See also List of glaciers in Canada References ^ GeoNames: Kaparoqtalik Glacier vteArctic Cordillera of CanadaRanges Adam Baffin Blackwelder Blue Boulder British Empire Bruce Byan Martin Challenge...

 

ジョン・ヘンリー・パーカーJohn Henry Parker 大佐だった頃の写真(1917年)渾名 「ガトリングガン・パーカー」(Gatling Gun Parker)生誕 (1866-09-09) 1866年9月9日 アメリカ合衆国 ミズーリ州セデーリア(英語版)死没 (1942-10-14) 1942年10月14日(76歳没) アメリカ合衆国 サンフランシスコ所属組織 アメリカ陸軍軍歴 1892年 - 1924年最終階級 准将(Brigadier General)テンプレートを表示 ジョン...

У Вікіпедії є статті про інших людей із прізвищем Вишеславський. Леонід Миколайович ВишеславськийПортрет Леоніда Вишеславського, зроблений його донькою Іриною, 1984 рікНародився5 (18) березня 1914Миколаїв, Російська імперіяПомер27 грудня 2002(2002-12-27)[1] (88 років)Київ, Україна...

 

1999 book by Ellen Meiksins Wood The Origin of Capitalism AuthorEllen Meiksins WoodLanguageEnglishSubjectHistory of capitalismPublisherMonthly Review PressPublication date1999Publication placeUnited StatesPagesvii, 138ISBN978-1-58367-007-1Dewey Decimal330.12/2/09LC ClassHB501 .W915 The Origin of Capitalism is a 1999 book on history and political economy, specifically the history of capitalism, by the political theorist Ellen Meiksins Wood, written from the perspective of political Marxis...