Technopedia Center
PMB University Brochure
Faculty of Engineering and Computer Science
S1 Informatics S1 Information Systems S1 Information Technology S1 Computer Engineering S1 Electrical Engineering S1 Civil Engineering

faculty of Economics and Business
S1 Management S1 Accountancy

Faculty of Letters and Educational Sciences
S1 English literature S1 English language education S1 Mathematics education S1 Sports Education
teknopedia

teknopedia

teknopedia

teknopedia

teknopedia

teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
teknopedia
  • Registerasi
  • Brosur UTI
  • Kip Scholarship Information
  • Performance
  1. Weltenzyklopädie
  2. Automatic Reference Counting - Teknopedia
Automatic Reference Counting - Teknopedia

Nella programmazione Objective-C, Automatic Reference Counting (ARC) è un miglioramento del sistema di gestione della memoria, dove il problema di tenere traccia del reference count di un oggetto viene spostato dal programmatore al compilatore.[1]

Nella programmazione Objective-C tradizionale, il programmatore avrebbe dovuto mandare dei messaggi di retain e release agli oggetti per deallocare o prevenire la deallocazione.[2] Con ARC, il compilatore lo fa automaticamente esaminando il codice sorgente e aggiungendo i messaggi di retain e release nel codice compilato.[3]

ARC non è uguale al garbage collector, visto che non ci sono thread in background che agiscono per deallocare gli oggetti che non sono più puntati in altre parti del codice.[4] Al contrario del garbage collector, ARC non gestisce automaticamente reference counting i riferimenti nei clicli; è compito del programmatore fermare i cicli utilizzando weak references[5]

ARC è stato introdotto da Apple Inc. nel 2011 per lo sviluppo di applicazioni su OS X Lion e iOS 5[6].

David Chisnall ainformIT ha detto di vedere ARC come "the first significant improvement to Objective-C since the 1980s" (il primo miglioramento significativo per l'Objective-C dagli anni '80).[7]

ARC è supportato in Xcode 4.2 o superiori, OS X Snow Leopard o superiori, e iOS 4.0 o superiori, anche se da OS X Lion e iOS 5 viene raccomandato di utilizzarlo, weak references inclusi.

Note

[modifica | modifica wikitesto]
  1. ^ John Siracusa, Automatic Reference Counting, su Mac OS X 10.7 Lion: the Ars Technica review, https://arstechnica.com/. URL consultato il 15 agosto 2012.
  2. ^ José R.C. Cruz, Automatic Reference Counting on iOS, su drdobbs.com, Dr.Dobb's. URL consultato il 21 agosto 2012 (archiviato dall'url originale il 16 agosto 2012).
  3. ^ Stephen G. Kochan, Programming in Objective-C, 4th, Boston, Mass., Addison-Wesley, 1912, p. 408, ISBN 978-0-321-81190-5.
  4. ^ Kevin Hoffman, Sams teach yourself Mac OS X Lion app development in 24 hours, Indianapolis, Ind., Sams, 2012, p. 73, ISBN 978-0-672-33581-5.
  5. ^ General, su Automatic Reference Counting, https://clang.llvm.org/. URL consultato il 15 agosto 2012.
  6. ^ Kazuki Sakamoto, Pro Multithreading and Memory Management for Ios and OS X With Arc, Grand Central Dispatch and Blocks., Apress, 2012, xii, ISBN 978-1-4302-4116-4.
  7. ^ David Chisnall, Automatic Reference Counting in Objective-C, Part 2: The Details, su informit.com, informIT. URL consultato il 18 agosto 2012.

Voci correlate

[modifica | modifica wikitesto]
  • Objective-C
  • Garbage collection
  • Gestione della memoria
  • Memory leak

Collegamenti esterni

[modifica | modifica wikitesto]
  • (EN) Transitioning to ARC – iOS Developer Library, su developer.apple.com.
  Portale Informatica: accedi alle voci di Teknopedia che trattano di informatica
Estratto da "https://it.wikipedia.org/w/index.php?title=Automatic_Reference_Counting&oldid=107941592"

  • Indonesia
  • English
  • Français
  • 日本語
  • Deutsch
  • Italiano
  • Español
  • Русский
  • فارسی
  • Polski
  • 中文
  • Nederlands
  • Português
  • العربية
Pusat Layanan

UNIVERSITAS TEKNOKRAT INDONESIA | ASEAN's Best Private University
Jl. ZA. Pagar Alam No.9 -11, Labuhan Ratu, Kec. Kedaton, Kota Bandar Lampung, Lampung 35132
Phone: (0721) 702022