http://www.aros.orgAROS-ExecAROS-Exec ArchivesPower2People

Home

English

Česky

Deutsch

Ελληυικά

Français

Italiano

Nederlands

Polski

Português

Русский

Español

Suomi

Svenska


Novitą

Archivio

Introduzione

Stato
Foto
Porting
Licenza

Download


Documentazione

Utenti
Installazione
Come si usa
Comandi shell
Applications
FAQ
Sviluppatori
Per contribuire
Roadmap
Bug Tracker
Lavorare con Subversion
Compilare
Manuale Sviluppo Applicazioni
Manuale Sviluppo Applicazioni Zune
Manuale Sviluppo Sistema
Manuale Debugging
Riferimenti
Specifiche
Guida stili UI
Documentazione
Porting
Traduzione
Sommari
Links

Contatti

Mailing list
Canali IRC

Riconoscimenti

Acknowledgements


Immagini

Sviluppatori
Ciurma degli sviluppatori

Sponsor

Collegamenti

Links

Get AROS Research Operating System at SourceForge.net. Fast, secure and Free Open Source software downloads

AROS Application Development Manual

Index

Avvertenza

This document is not finished! It is highly likely that many parts are out-of-date, contain incorrect information or are simply missing altogether. If you want to help rectify this, please contact us.

Resource Tracking (RT)

Everyone talks about RT but what's it anyway? RT means three things:

  1. The OS takes notes about allocated resources (eg. memory, windows, libraries, devices, screens, etc).
  2. The OS checks the usage of those resources (ie. Did you open that window you want to render into? Is it still open? Is that a window anyway?)
  3. The OS closes resources if they are no longer used (either because your program crashed or because it exited without freeing them).

The current implementation can do all three things but to enable it, you must make some modifications to your code. The only disadvantage of the current implementation is that the resources won't be freed if the program crashes.

  1. Add the following lines to your code. It should be the first thing seen by the compiler:

    #define ENABLE_RT  1
    

    If you replace the 1 by 0, then RT will be silently disabled.

  2. Add #include <aros/rt.h> after the last include from proto/

  3. Add RT_Init(); as the first command in main().

  4. Call RT_Exit() before you terminate your program.

  5. Recompile.

The advantages are that you will get errors if you try to access resources which you didn't allocate and that you will get a list of resources which you didn't free at the end of your program. All messages will contain the position in the code where the error happened (if available) and the position in the code where the resource was allocated (this is the reason why RT has to be compiled in. It could be built into the OS, too, but it would be hard to gather the information where an error occurred).

A good example about how to use RT and what it can do can be found in AROS/workbench/demos/rtdemo.c.

The following resources are tracked:

  • Memory in AllocMem(), FreeMem(),``AllocVec()`` and FreeVec()
  • MsgPorts in CreateMsgPort(), DeleteMsgPort(), CreatePort(), DeletePort() and PutMsg()
  • Files in Open(), Close(), Read() and Write(). Read() and Write() also check their buffers.
  • Windows in OpenWindow(), OpenWindowTags(), OpenWindowTagList(), CloseWindow(), WindowToFront(), WindowToBack()
  • Screens in OpenScreen(), OpenScreenTags(), OpenScreenTagList(), CloseScreen(), ScreenToFront(), ScreenToBack(). CloseScreen() also checks for open windows on the screen before closing.

Copyright © 1995-2009, The AROS Development Team. Tutti i diritti riservati.
Amiga® č un marchio registrato di Amiga Inc. Tutti i diritti sui marchi vanno ai legittimi proprietari.