Add additional comments to Aligned Allocator (GH #779)

pull/795/head
Jeffrey Walton 2019-01-16 17:04:55 -05:00
parent 3fba3b0a1c
commit 7969f7181f
No known key found for this signature in database
GPG Key ID: B36AB348921B1838
1 changed files with 3 additions and 0 deletions

View File

@ -298,10 +298,13 @@ void * AlignedAllocate(size_t size)
#ifdef CRYPTOPP_NO_ALIGNED_ALLOC
size_t adjustment = 16-((size_t)p%16);
CRYPTOPP_ASSERT(adjustment > 0);
p += adjustment;
p[-1] = (byte)adjustment;
#endif
// If this assert fires then there are problems that need
// to be fixed. Please open a bug report.
CRYPTOPP_ASSERT(IsAlignedOn(p, 16));
return p;
}