[all-commits] [llvm/llvm-project] ef74f0: [libc++abi] Remove redundant null pointer check in...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Dec 16 13:30:00 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ef74f0fdc33909d0e29a8206debd73d7673791c6
      https://github.com/llvm/llvm-project/commit/ef74f0fdc33909d0e29a8206debd73d7673791c6
  Author: Fangrui Song <i at maskray.me>
  Date:   2020-12-16 (Wed, 16 Dec 2020)

  Changed paths:
    M libcxxabi/src/stdlib_new_delete.cpp

  Log Message:
  -----------
  [libc++abi] Remove redundant null pointer check in operator delete

Similar to D52401. Normally operator delete is defined in libc++abi
(LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS is off by default).

C89 4.10.3.2 The free function
C99 7.20.3.2 The free function
C11 7.22.3.3 The free function

    If ptr is a null pointer, no action shall occur.

free on MSDN:

    If memblock is NULL, the pointer is ignored and free immediately returns.

Reviewed By: #libc_abi, ldionne

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




More information about the All-commits mailing list