Rename the ALIGN macro to LINT_ALIGN so it does not clash with machine/param.h
Bump the alignment to 16bytes because lint1 memory allocator is used for objects that require 16bytes alignment on amd64 (ie. val_t). This makes lint1 work when compiled with compiler(s) that use SSE for memcpy on amd64. (e.g. clang). Approved by: ed (mentor)
This commit is contained in:
parent
a3238bcf8f
commit
7f18fc27cd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=206424
@ -825,15 +825,15 @@ getbound(type_t *tp)
|
|||||||
} else if (t == FUNC) {
|
} else if (t == FUNC) {
|
||||||
/* compiler takes alignment of function */
|
/* compiler takes alignment of function */
|
||||||
error(14);
|
error(14);
|
||||||
a = ALIGN(1) * CHAR_BIT;
|
a = LINT_ALIGN(1) * CHAR_BIT;
|
||||||
} else {
|
} else {
|
||||||
if ((a = size(t)) == 0) {
|
if ((a = size(t)) == 0) {
|
||||||
a = CHAR_BIT;
|
a = CHAR_BIT;
|
||||||
} else if (a > ALIGN(1) * CHAR_BIT) {
|
} else if (a > LINT_ALIGN(1) * CHAR_BIT) {
|
||||||
a = ALIGN(1) * CHAR_BIT;
|
a = LINT_ALIGN(1) * CHAR_BIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (a < CHAR_BIT || a > ALIGN(1) * CHAR_BIT)
|
if (a < CHAR_BIT || a > LINT_ALIGN(1) * CHAR_BIT)
|
||||||
lerror("getbound() 1");
|
lerror("getbound() 1");
|
||||||
return (a);
|
return (a);
|
||||||
}
|
}
|
||||||
|
@ -38,8 +38,8 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include "op.h"
|
#include "op.h"
|
||||||
|
|
||||||
/* XXX - works for most systems, but the whole ALIGN thing needs to go away */
|
/* XXX - works for most systems, but the whole ALIGN thing needs to go away */
|
||||||
#ifndef ALIGN
|
#ifndef LINT_ALIGN
|
||||||
#define ALIGN(x) (((x) + 7) & ~7)
|
#define LINT_ALIGN(x) (((x) + 15) & ~15)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -203,7 +203,7 @@ xgetblk(mbl_t **mbp, size_t s)
|
|||||||
void *p;
|
void *p;
|
||||||
size_t t = 0;
|
size_t t = 0;
|
||||||
|
|
||||||
s = ALIGN(s);
|
s = LINT_ALIGN(s);
|
||||||
if ((mb = *mbp) == NULL || mb->nfree < s) {
|
if ((mb = *mbp) == NULL || mb->nfree < s) {
|
||||||
if ((mb = frmblks) == NULL) {
|
if ((mb = frmblks) == NULL) {
|
||||||
if (s > mblklen) {
|
if (s > mblklen) {
|
||||||
|
Loading…
Reference in New Issue
Block a user