From: Steve Capper Date: Sat, 22 Feb 2025 18:51:55 +0000 (-0500) Subject: Remove unaligned mem-accesses from test_malloc_pools.cpp X-Git-Tag: archive/raspbian/2022.0.0-2+rpi1^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fae18e38b0fbdf321c169572ff54c57bc139f402;p=onetbb.git Remove unaligned mem-accesses from test_malloc_pools.cpp Last-Changed: 2017-08-13 Forwarded: no This should help sparc64 tests, if we miss a case a SIGBUS will greet us. Gbp-Pq: Name 1000-remove-unaligned-test.patch --- diff --git a/test/tbbmalloc/test_malloc_pools.cpp b/test/tbbmalloc/test_malloc_pools.cpp index f73c28e..8f83d76 100644 --- a/test/tbbmalloc/test_malloc_pools.cpp +++ b/test/tbbmalloc/test_malloc_pools.cpp @@ -66,11 +66,11 @@ static std::atomic liveRegions; static void *getMallocMem(intptr_t /*pool_id*/, size_t &bytes) { - void *rawPtr = malloc(bytes+sizeof(MallocPoolHeader)+1); + void *rawPtr = malloc(bytes+sizeof(MallocPoolHeader)); if (!rawPtr) return nullptr; // +1 to check working with unaligned space - void *ret = (void *)((uintptr_t)rawPtr+sizeof(MallocPoolHeader)+1); + void *ret = (void *)((uintptr_t)rawPtr+sizeof(MallocPoolHeader)); MallocPoolHeader *hdr = (MallocPoolHeader*)ret-1; hdr->rawPtr = rawPtr;