a cache:0x7ffc24ff22e8
b cache:0x7ffc24ff22e8
a cache:0x7ffc24ff2228
like this example, there is a static variable inside function a, and another static variable inside function b, then, function b would call a in the end.
In my expect, the static variable inside b should be same instance, but in result, the point address is a same as b, but in different call, the static variable inside b is different instance.
for example: lazy_static: v1.4.0
the result is:
like this example, there is a static variable inside function
a
, and another static variable inside functionb
, then, functionb
would calla
in the end.In my expect, the static variable inside
b
should be same instance, but in result, the point address isa
same asb
, but in different call, the static variable insideb
is different instance.I'm confuse with this.
In normal case:
the result is :
this is what in my expect.