[cc65] atexit() destructor priority

From: Oliver Schmidt <ol.sc1web.de>
Date: 2011-01-26 15:05:01

Both according to the docs and the source (as far as I understand it)
the calling order for both constructors and destructors is "highest
priority first".

From that I would have thought that the atexit() destructor would have
the highest possible priority (29 ?) as it seems reasonable to do
first the user-level cleanup and then the system-level cleanup.

But in fact the priority of the atexit() destructor is quite low - it's 5.

- This goesn't guarantee a defined order if there are more than four
destructors without explicit priority.
- The closeallfiles destructor has a priority of 17 on all targets it
is present - meaning that atexit routines have no way to access "still
open" files.

Is that behaviour intentional? Do I miss a point?

To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed, 26 Jan 2011 15:05:01 +0100

This archive was generated by hypermail 2.1.8 : 2011-01-26 15:05:20 CET