mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
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:
parent
87ee43c6dd
commit
b3bd3dc830
5 changed files with 43 additions and 7 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue