Update comments
parent
36318790a2
commit
4fc5b8da13
18
secblock.h
18
secblock.h
|
|
@ -447,18 +447,20 @@ private:
|
||||||
// If we can't control alignment through CRYPTOPP_ALIGN_DATA then we
|
// If we can't control alignment through CRYPTOPP_ALIGN_DATA then we
|
||||||
// should probably avoid this allocator.
|
// should probably avoid this allocator.
|
||||||
//
|
//
|
||||||
// Platforms that probably experience trouble at this point are AIX and
|
// Platforms that experience trouble at this point are AIX and Solaris
|
||||||
// Solaris when Sun Studio is less than 12.0 or 12.1. The easiest way
|
// when Sun Studio is less than 12.0 or 12.1. The easiest way to check
|
||||||
// to check is a Debug build so asserts are enabled. Then look for an
|
// is a Debug build so asserts are enabled. Then look for an assert to
|
||||||
// assert to fire on m_allocated when the dtor runs. For Sun Studio 12
|
// fire on m_allocated when the dtor runs. For Sun Studio 12 we were
|
||||||
// we were able to clear the assert by using __attribute__(aligned).
|
// 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
|
// 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
|
// 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
|
// believe ptrdiff_t the only way to safely calculate the aligned
|
||||||
// address due to the subtraction. Attempts to use ptrdiff_t result in
|
// address due to the pointer subtraction. Attempts to use ptrdiff_t
|
||||||
// crashes or SIGSEGV's. That's probably a good sign we should switch to
|
// result in crashes or SIGSEGV's. That's probably a sign we should
|
||||||
// something else, like a SecBlock backed by a heap allocation.
|
// switch to something else without the twiddling, like a SecBlock
|
||||||
|
// backed by an aligned heap allocation.
|
||||||
|
|
||||||
#ifdef __BORLANDC__
|
#ifdef __BORLANDC__
|
||||||
T* GetAlignedArray() {return m_array;}
|
T* GetAlignedArray() {return m_array;}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue