fix 32 bit atoms to ensure alignment at 8 bytes (broken with blobs).
This commit is contained in:
parent
514758e65b
commit
b02507ed22
10
H/Atoms.h
10
H/Atoms.h
@ -27,6 +27,11 @@
|
||||
|
||||
#include <wchar.h>
|
||||
|
||||
typedef struct atom_blob {
|
||||
size_t length;
|
||||
char data[MIN_ARRAY];
|
||||
} atom_blob_t;
|
||||
|
||||
/********* operations for atoms ****************************************/
|
||||
|
||||
/* Atoms are assumed to be uniquely represented by an OFFSET and to have
|
||||
@ -55,10 +60,7 @@ typedef struct AtomEntryStruct
|
||||
union {
|
||||
char uStrOfAE[MIN_ARRAY]; /* representation of atom as a string */
|
||||
wchar_t uWStrOfAE[MIN_ARRAY]; /* representation of atom as a string */
|
||||
struct {
|
||||
size_t length; /* size of blob */
|
||||
char data[MIN_ARRAY]; /* data */
|
||||
} blob;
|
||||
struct atom_blob blob[MIN_ARRAY];
|
||||
} rep;
|
||||
}
|
||||
AtomEntry;
|
||||
|
@ -85,11 +85,11 @@ PL_blob_data(atom_t a, size_t *len, struct PL_blob_t **type)
|
||||
return x->StrOfAE;
|
||||
}
|
||||
if ( len )
|
||||
*len = x->rep.blob.length;
|
||||
*len = x->rep.blob[0].length;
|
||||
if ( type )
|
||||
*type = RepBlobProp(x->PropsOfAE)->blob_t;
|
||||
|
||||
return x->rep.blob.data;
|
||||
return x->rep.blob[0].data;
|
||||
}
|
||||
|
||||
PL_EXPORT(void)
|
||||
|
Reference in New Issue
Block a user