From 0770c0c0b3c0795f5de4893e058df5c34aac8981 Mon Sep 17 00:00:00 2001 From: James David Berry <jberry@apache.org> Date: Mon, 27 Oct 2003 14:47:33 +0000 Subject: [PATCH] Add comment regarding permissible values for XML_PLATFORM_NEW_BLOCK_ALIGNMENT. git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175319 13f79535-47bb-0310-9956-ffa450edef68 --- src/xercesc/util/PlatformUtils.hpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/xercesc/util/PlatformUtils.hpp b/src/xercesc/util/PlatformUtils.hpp index 923683e90..d6c30ffc7 100644 --- a/src/xercesc/util/PlatformUtils.hpp +++ b/src/xercesc/util/PlatformUtils.hpp @@ -804,12 +804,22 @@ MakeXMLException(XMLPlatformUtilsException, XMLUTIL_EXPORT) // Calculate alignment required by platform for a new // block allocation. We use this in our custom allocators // to ensure that returned blocks are properly aligned. -// Note that, although this will take a pointer and return the position -// at which it should be placed for correct alignment, in our code -// we normally use size_t parameters to discover what the alignment -// of header blocks should be. Thus, if this is to be -// used for the former purpose, to make compilers happy -// some casting will be necessary - neilg. +// Note that, although this will take a pointer and return the position +// at which it should be placed for correct alignment, in our code +// we normally use size_t parameters to discover what the alignment +// of header blocks should be. Thus, if this is to be +// used for the former purpose, to make compilers happy +// some casting will be necessary - neilg. +// +// Note: XML_PLATFORM_NEW_BLOCK_ALIGNMENT may be specified on a +// per-architecture basis to dictate the alignment requirements +// of the architecture. In the absense of this specification, +// this routine guesses at the correct alignment value. +// +// A XML_PLATFORM_NEW_BLOCK_ALIGNMENT value of zero is illegal. +// If a platform requires absolutely no alignment, a value +// of 1 should be specified ("align pointers on 1 byte boundaries"). +// inline size_t XMLPlatformUtils::alignPointerForNewBlockAllocation(size_t ptrSize) { -- GitLab