Hi, all.
I looked at atexit() and atexitdont() and i don't understand why these
functions are implemented with a static array instead of singly linked list?
May be somebody with a greater plan9 experience can help me with my question.
If i do:
#include <u.h>
#include <libc.h>
void f1(void)
{
print("f1\n");
}
void f2(void)
{
print("f2\n");
}
void main(int, char**)
{
atexit(f1);
atexit(f2);
atexit(f1);
atexitdont(f2);
atexit(f2);
exits(nil);
}
i get:
f1
f2
f1
instead of:
f1
f1
f2
because of atexit.c source code.
Thanks.