[all-commits] [llvm/llvm-project] 4e3dac: [scudo] Call __scudo_deallocate_hook on reallocati...

Guillaume Chelfi via All-commits all-commits at lists.llvm.org
Tue Feb 14 11:04:37 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e3dac6f0a4c419ee0cd575407e95f3833a01a2e
      https://github.com/llvm/llvm-project/commit/4e3dac6f0a4c419ee0cd575407e95f3833a01a2e
  Author: Guillaume Chelfi <chelfi at google.com>
  Date:   2023-02-14 (Tue, 14 Feb 2023)

  Changed paths:
    M compiler-rt/lib/scudo/standalone/allocator_config.h
    M compiler-rt/lib/scudo/standalone/combined.h
    M compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
    A compiler-rt/lib/scudo/standalone/tests/scudo_hooks_test.cpp

  Log Message:
  -----------
  [scudo] Call __scudo_deallocate_hook on reallocations.

Scudo is expected to call __scudo_allocate_hook on allocations, and
__scudo_deallocate_hook on deallocations, but it's behavior is not
clear on reallocations. Currently, non-trivial reallocations call
__scudo_allocate_hook but never __scudo_deallocate_hook. We should
prefer either calling both, none, or a dedicated
hook (__scudo_reallocate_hook, for instance).

This patch implements the former, and adds a unit test to enforce
those expectations.

Reviewed By: Chia-hungDuan

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




More information about the All-commits mailing list