Stream: t-lang/wg-unsafe-code-guidelines

Topic: unused timestamps


gnzlbg (Feb 21 2019 at 12:27, on Zulip):

@RalfJ what are unused time stamps for? When one pushes something off the stack, then that time-stamp becomes "unused" I guess

gnzlbg (Feb 21 2019 at 12:27, on Zulip):

but why does Tracking need to keep track of the next unused one ?

RalfJ (Feb 21 2019 at 14:02, on Zulip):

it's just a monotonically increasing counter

RalfJ (Feb 21 2019 at 14:02, on Zulip):

and the next not-yet-used (as in handed out) timestamp must be stored somewhere

RalfJ (Feb 21 2019 at 14:02, on Zulip):

nothing complicated^^

RalfJ (Feb 21 2019 at 14:03, on Zulip):

I must be doing something wrong if I invoke complicated thoughts involving garbage collection of timestamps, but I have no idea what it is I am doing wrong...

gnzlbg (Feb 21 2019 at 14:09, on Zulip):

and the next not-yet-used (as in handed out) timestamp must be stored somewhere

Ah, so this is stored there after it is handed out and before it is used? I guess what I'm missing is, why not just create a new time stamp when you need it, as in, why does it need to create it before, and store it there, and then fetch it from there?

RalfJ (Feb 21 2019 at 14:09, on Zulip):

it needs to know which IDs are already used and which aren't?

RalfJ (Feb 21 2019 at 14:10, on Zulip):

and it should not have to scan all memory for that

RalfJ (Feb 21 2019 at 14:10, on Zulip):

this is a standard data structure: a thing that, every time you ask it, gives you a new never-before-seen ID

RalfJ (Feb 21 2019 at 14:10, on Zulip):

I even have the code for that in https://github.com/RalfJung/unsafe-code-guidelines/blob/stacked-borrows/wip/stacked-borrows.md#generating-timestampts

gnzlbg (Feb 21 2019 at 14:13, on Zulip):

ah duh, the clock is the timestamp counter

gnzlbg (Feb 21 2019 at 14:14, on Zulip):

nvm, I don't know why unused confused me, I probably wasn't seen that part below in the diff

Last update: Nov 19 2019 at 19:05UTC