From 4fc5b8da1309af4b3936761d8411c8bd45178d71 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 30 Jul 2018 15:18:59 -0400 Subject: [PATCH] Update comments --- secblock.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/secblock.h b/secblock.h index 286e9cff..56dfe69b 100644 --- a/secblock.h +++ b/secblock.h @@ -447,18 +447,20 @@ private: // If we can't control alignment through CRYPTOPP_ALIGN_DATA then we // should probably avoid this allocator. // - // Platforms that probably experience trouble at this point are AIX and - // Solaris when Sun Studio is less than 12.0 or 12.1. The easiest way - // to check is a Debug build so asserts are enabled. Then look for an - // assert to fire on m_allocated when the dtor runs. For Sun Studio 12 - // we were able to clear the assert by using __attribute__(aligned). + // Platforms that experience trouble at this point are AIX and Solaris + // when Sun Studio is less than 12.0 or 12.1. The easiest way to check + // is a Debug build so asserts are enabled. Then look for an assert to + // fire on m_allocated when the dtor runs. For Sun Studio 12 we were + // able to clear the assert by using __attribute__(aligned). However + // Sun Studio 11 and earlier still have the problem. // // Something else that troubles me about the machinery below is, we // can't use std::ptrdiff_t in place of the byte* and size_t casts. I // believe ptrdiff_t the only way to safely calculate the aligned - // address due to the subtraction. Attempts to use ptrdiff_t result in - // crashes or SIGSEGV's. That's probably a good sign we should switch to - // something else, like a SecBlock backed by a heap allocation. + // address due to the pointer subtraction. Attempts to use ptrdiff_t + // result in crashes or SIGSEGV's. That's probably a sign we should + // switch to something else without the twiddling, like a SecBlock + // backed by an aligned heap allocation. #ifdef __BORLANDC__ T* GetAlignedArray() {return m_array;}