Re: commit -- fixed UT_RBTree erase method


Subject: Re: commit -- fixed UT_RBTree erase method
From: Mike Nordell (tamlin@algonet.se)
Date: Fri Jul 20 2001 - 04:31:07 CDT


Joaquin Cuenca Abela wrote:
>
> I've tested it with 100000 random insertions and
> deletes, checking its integrity after each operation,
> and so far everything is ok.

Great!

> P.S.: Anybody knows if we can safely suppose that our
> supported compilers do the right thing in presence of
> an inlined function that declares a static variable?

Assuming s/declare/define/, and what you had in mind was something like:

#include <stdio.h>
inline void foo() { static int i=0; printf("%d\n", ++i); }
void t1() { foo(); }
void t2() { foo(); }
int main() { t1(); t2(); return 0; }

then, even that the code gerenared (printf...) gets inlined into t1 and t2,
MSVC outputs
1
2

i.e. it treats it as the one and same static variable. I'd strongly
recomment against such constructions. What problem are you trying to solve?

/Mike



This archive was generated by hypermail 2b25 : Fri Jul 20 2001 - 04:28:55 CDT