added community/heaptrack

This commit is contained in:
Kevin Mihelich 2019-10-06 20:30:25 +00:00
parent 42531e0a79
commit 6dc7ed91d4
2 changed files with 81 additions and 0 deletions

View file

@ -0,0 +1,40 @@
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - patch from Fedora to fix 32-bit FTBFS
pkgname=heaptrack
pkgver=1.1.0
pkgrel=5
arch=(x86_64)
pkgdesc="A heap memory profiler for Linux"
url="http://milianw.de/tag/heaptrack"
license=(GPL)
depends=(kdiagram threadweaver kitemmodels kio boost-libs hicolor-icon-theme)
makedepends=(extra-cmake-modules boost sparsehash)
source=(https://download.kde.org/stable/$pkgname/$pkgver/$pkgname-$pkgver.tar.xz{,.sig}
heaptrack-fix-build-on-32bit.patch)
sha256sums=('120f8b276f772aa3409fc3d628dbe7c4fa9d0d98cd710982b6007e6113e13f3b'
'SKIP'
'c96023dc03b0b9227f71447f209fc63ee60b7b4a7bec5f92c18aa86693d90ab7')
validpgpkeys=(3D8568869097C65C98F8D2760C0EB212CD1D1393
C51B45A532F17FA401D099A0A0C6B72C4F1C5E7C) # Milian Wolff <mail@milianw.de>
prepare() {
mkdir -p build
cd $pkgname-$pkgver
patch -p1 -i ../heaptrack-fix-build-on-32bit.patch
}
build() {
cd build
cmake ../$pkgname-$pkgver \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_TESTING=OFF
make
}
package(){
cd build
make DESTDIR="$pkgdir" install
}

View file

@ -0,0 +1,41 @@
diff --git a/tests/auto/tst_io.cpp b/tests/auto/tst_io.cpp
index 48abda6..fd31b31 100644
--- a/tests/auto/tst_io.cpp
+++ b/tests/auto/tst_io.cpp
@@ -27,6 +27,11 @@
using namespace std;
+constexpr uint64_t operator""_u64(unsigned long long v)
+{
+ return static_cast<uint64_t>(v);
+}
+
TEST_CASE ("write data", "[write]") {
TempFile file;
REQUIRE(file.open());
@@ -124,7 +129,7 @@ TEST_CASE ("read line 64bit", "[read]") {
REQUIRE(reader >> module);
REQUIRE(module == "/tmp/KDevelop-5.2.1-x86_64/usr/lib/libKF5Completion.so.5");
- for (uint64_t expected : {0x7f48beedc00ul, 0x0ul, 0x36854ul, 0x236858ul, 0x2700ul}) {
+ for (auto expected : {0x7f48beedc00_u64, 0x0_u64, 0x36854_u64, 0x236858_u64, 0x2700_u64}) {
uint64_t addr = 0;
REQUIRE(reader >> addr);
REQUIRE(addr == expected);
diff --git a/src/util/linewriter.h b/src/util/linewriter.h
index 73a7930..e895e87 100644
--- a/src/util/linewriter.h
+++ b/src/util/linewriter.h
@@ -158,6 +158,11 @@ public:
return __builtin_clzl(V);
}
+ inline static unsigned clz(long long unsigned V)
+ {
+ return __builtin_clzll(V);
+ }
+
template <typename V>
static char* writeHexNumber(char* buffer, V value)
{