[all-commits] [llvm/llvm-project] a6500b: scudo: Optimize getSizeLSBByClassId() by compressi...

pcc via All-commits all-commits at lists.llvm.org
Thu Apr 22 15:35:58 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a6500b013a257c969e19ce0d8414ff43fe9bd4fa
      https://github.com/llvm/llvm-project/commit/a6500b013a257c969e19ce0d8414ff43fe9bd4fa
  Author: Peter Collingbourne <peter at pcc.me.uk>
  Date:   2021-04-22 (Thu, 22 Apr 2021)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/size_class_map.h

  Log Message:
  -----------
  scudo: Optimize getSizeLSBByClassId() by compressing the table into an integer if possible. NFCI.

With AndroidSizeClassMap all of the LSBs are in the range 4-6 so we
only need 2 bits of information per size class. Furthermore we have
32 size classes, which conveniently lets us fit all of the information
into a 64-bit integer. Do so if possible so that we can avoid a table
lookup entirely.

Differential Revision: https://reviews.llvm.org/D101105




More information about the All-commits mailing list