Mercurial > hg > CbC > CbC_llvm
diff unittests/Support/ManagedStatic.cpp @ 147:c2174574ed3a
LLVM 10
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 14 Aug 2019 16:55:33 +0900 |
parents | 3a76565eade5 |
children |
line wrap: on
line diff
--- a/unittests/Support/ManagedStatic.cpp Sat Feb 17 09:57:20 2018 +0900 +++ b/unittests/Support/ManagedStatic.cpp Wed Aug 14 16:55:33 2019 +0900 @@ -1,11 +1,12 @@ //===- llvm/unittest/Support/ManagedStatic.cpp - ManagedStatic tests ------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// + +#include "llvm/Support/Allocator.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Config/config.h" #ifdef HAVE_PTHREAD_H @@ -30,7 +31,7 @@ // Valgrind's leak checker complains glibc's stack allocation. // To appease valgrind, we provide our own stack for each thread. void *allocate_stack(pthread_attr_t &a, size_t n = 65536) { - void *stack = malloc(n); + void *stack = safe_malloc(n); pthread_attr_init(&a); #if defined(__linux__) pthread_attr_setstack(&a, stack, n); @@ -83,7 +84,7 @@ namespace CustomCreatorDeletor { struct CustomCreate { static void *call() { - void *Mem = std::malloc(sizeof(int)); + void *Mem = safe_malloc(sizeof(int)); *((int *)Mem) = 42; return Mem; }