Alignment fixes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16398 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-04-09 09:23:10 +00:00
parent ff61d3c061
commit 07aaa54e02
5 changed files with 43 additions and 7 deletions

View file

@ -472,6 +472,8 @@ static void unescape(const char *from, char * to)
*/
@implementation NSURL
static unsigned urlAlign;
/**
* Create and return a file URL with the supplied path.<br />
* The value of aPath must be a valid filesystem path.<br />
@ -486,6 +488,7 @@ static void unescape(const char *from, char * to)
{
if (clientsLock == nil)
{
urlAlign = objc_alignof_type(@encode(parsedURL));
clientsLock = [NSLock new];
}
}
@ -637,7 +640,7 @@ static void unescape(const char *from, char * to)
BOOL usesQueries = YES;
BOOL canBeGeneric = YES;
size += sizeof(parsedURL) + __alignof__(parsedURL) + 1;
size += sizeof(parsedURL) + urlAlign + 1;
buf = _data = (parsedURL*)NSZoneMalloc(GSAtomicMallocZone(), size);
memset(buf, '\0', size);
start = end = ptr = (char*)&buf[1];