linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC: ptrlist insert during iteration
@ 2017-08-10  3:56 Chris Li
  2017-08-10 23:28 ` Luc Van Oostenryck
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Li @ 2017-08-10  3:56 UTC (permalink / raw)
  To: Linux-Sparse; +Cc: Luc Van Oostenryck, Dibyendu Majumdar

I have give this a little bit more thought.
Find more bugs in the previous proposal.

Data structure:
occupier mask:
     indicate which ptrlist entry is valid.
insert mask:
     Indicate which ptrlist entry is new insert during current loop.

I find out for each ptr iteration. The insert mask need to restart
with fresh zero.
e.g. if the insert mask start with 00010B, and after the current
ptr iteration, the insert mask become 00110B. The loop iterator
has no way to tell if the new bit was insert before or after the
original bit.

That is the reason insert mask will need to start fresh zero
for each pointer iteration.

If there is nest loops, the inner loop will need to maintain and
merge the insert mask for the outer loop.

It need some thing similar to the ptrlist refcount to do some
save/merge on the insert mask context when iterator
enter/exit the ptrlist node.

It is pretty complicate, but do able if we really want to do it.

Chris

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-11 11:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-10  3:56 RFC: ptrlist insert during iteration Chris Li
2017-08-10 23:28 ` Luc Van Oostenryck
2017-08-11  0:27   ` Chris Li
2017-08-11 11:10     ` Luc Van Oostenryck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).