[PATCH 0/9] ptrlist: make untagged pointers the 'normal' case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sparse makes an intensive usage of list of pointers (ptrlists).
These pointers can also be tagged but it's the exception, not the norm.

Regarding this, there is 3 categories of pointers and thus ptrlists:
1) aligned untagged pointers, the vast majority
2) aligned tagged pointers, only used exceptionnaly
3) non-aligned pointers, they can't be tagged and untagging would
   corrupt them.

The current code is do that the default case is that pointers are
tagged and non-aligned pointers are the exception (aligned untagged
are treated as special case where the tag is 00). This is reflected
both in the code and in the naming of the operations, mainly macros.
So the normal case must combine a raw pointer with a tag before storing
the pointer and must untag this cooked pointer when retrieving it.
This is done for pointers of type 1) & 2). For type 3) pointers
special macros exist which doesn't do the tag/untag operation.

This is from ideal since the vast majority of pointers have no tag
and so the tag/untag operations are unneeded for them.

This series change this and make the default case for type 1) & 3),
the ones which doesn't need tagging/untagging while the special macros
(suffixed by _TAG or _tag) exist for the special case of tagged pointers.

Luc Van Oostenryck (9):
  ptrlist: specialize __add_ptr_list() for tag/notag
  ptrlist: remove now unneeded add_ptr_list_notag()
  ptrlist: add helper PTR_UNTAG()
  ptrlist: rename PTR_ENTRY() to PTR_ENTRY_UNTAG()
  ptrlist: make explicit when tagged pointers are used.
  ptrlist: let FOR_EACH_PTR() ignore tags
  ptrlist: remove the now unneeded FOR_EACH_PTR_NOTAG()
  ptrlist: let {first,last}_ptr_list() return the raw pointer
  ptrlist: let sort_list() use the raw pointer

 README           |  4 ++--
 c2xml.c          |  4 ++--
 compile.c        |  4 ++--
 ctags.c          |  4 ++--
 example.c        | 20 ++++++++++----------
 graph.c          |  8 ++++----
 lib.c            |  2 +-
 obfuscate.c      |  4 ++--
 ptrlist.c        | 33 ++++++++++++++++++++++----------
 ptrlist.h        | 49 ++++++++++++++++++++++--------------------------
 sort.c           |  6 +++---
 sparse-llvm.c    |  4 ++--
 sparse.c         |  4 ++--
 test-dissect.c   |  4 ++--
 test-inspect.c   |  4 ++--
 test-lexing.c    |  4 ++--
 test-linearize.c |  4 ++--
 test-parsing.c   |  4 ++--
 test-unssa.c     |  4 ++--
 19 files changed, 89 insertions(+), 81 deletions(-)

-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux