|
|
|
|
|
by aw1621107
262 days ago
|
|
> In SPlint you would describe something as `special` and then describe the individual elements. Interesting. That does seem to provide more flexibility, though based on what the manual says I still feel like it's not quite to the same level as named lifetimes since `special` looks like it revolves around allocation/initialization? At least based on a quick skim of the manual structs with non-owning pointers still seems like a potential difference since from what I can tell struct field checks are either for ownership (/@only@/ for fields by default), initialization/allocation (`partial`, state clauses), or requires overhead (/@refs@/). Nothing quite like "the data here will live for some arbitrary lifetime(s) dictated by the use context". > Aliasing is mutual and storage refers to the region an object lives. It doesn't refer to exact pointer values. I... think that answers my question? Some quick tests seem to bear that out as well. > $ cat test.c So I think I'm a bit dim and for some reason I thought Splint was not free. Sorry for the bother! I could have tried things out myself this entire time! Good to see that /@returned@/ works like I hoped at least. |
|
Then I don't understand (your/Rusts) understanding of lifetimes. As to my understanding, the lifetime of an object is bound by the lifetime of the underlying allocation and is the time during which the storage of the allocation is initialized without interruption.
> I thought Splint was not free
It is for example in Debian, but I have recompiled it myself, since the Debian version has some bugs.