diff options
| author | Paul Eggert | 2016-06-19 01:07:55 +0200 |
|---|---|---|
| committer | Paul Eggert | 2016-06-19 04:32:59 +0200 |
| commit | 13feb31c633a26ce47799315326e43d1e8b9345a (patch) | |
| tree | 88c3877e10a3da9b4f64b38586090cf9d9ab9899 /src | |
| parent | a985d2b09bb88f31b27b02c3131cb34c5879d767 (diff) | |
| download | emacs-13feb31c633a26ce47799315326e43d1e8b9345a.tar.gz emacs-13feb31c633a26ce47799315326e43d1e8b9345a.zip | |
Rename ALIGN to pointer_align
* src/alloc.c (pointer_align): Rename from ALIGN.
This fixes Bug#23764 in a simpler way.
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/alloc.c b/src/alloc.c index 8173615992f..0a3e7d42a4f 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -486,15 +486,10 @@ static void *pure_alloc (size_t, int); | |||
| 486 | ? ((x) + (y) - 1) - ((x) + (y) - 1) % (y) \ | 486 | ? ((x) + (y) - 1) - ((x) + (y) - 1) % (y) \ |
| 487 | : ((x) + (y) - 1) & ~ ((y) - 1)) | 487 | : ((x) + (y) - 1) & ~ ((y) - 1)) |
| 488 | 488 | ||
| 489 | /* Bug#23764 */ | ||
| 490 | #ifdef ALIGN | ||
| 491 | # undef ALIGN | ||
| 492 | #endif | ||
| 493 | |||
| 494 | /* Return PTR rounded up to the next multiple of ALIGNMENT. */ | 489 | /* Return PTR rounded up to the next multiple of ALIGNMENT. */ |
| 495 | 490 | ||
| 496 | static void * | 491 | static void * |
| 497 | ALIGN (void *ptr, int alignment) | 492 | pointer_align (void *ptr, int alignment) |
| 498 | { | 493 | { |
| 499 | return (void *) ROUNDUP ((uintptr_t) ptr, alignment); | 494 | return (void *) ROUNDUP ((uintptr_t) ptr, alignment); |
| 500 | } | 495 | } |
| @@ -1259,7 +1254,7 @@ lisp_align_malloc (size_t nbytes, enum mem_type type) | |||
| 1259 | abase = base = aligned_alloc (BLOCK_ALIGN, ABLOCKS_BYTES); | 1254 | abase = base = aligned_alloc (BLOCK_ALIGN, ABLOCKS_BYTES); |
| 1260 | #else | 1255 | #else |
| 1261 | base = malloc (ABLOCKS_BYTES); | 1256 | base = malloc (ABLOCKS_BYTES); |
| 1262 | abase = ALIGN (base, BLOCK_ALIGN); | 1257 | abase = pointer_align (base, BLOCK_ALIGN); |
| 1263 | #endif | 1258 | #endif |
| 1264 | 1259 | ||
| 1265 | if (base == 0) | 1260 | if (base == 0) |
| @@ -5178,7 +5173,7 @@ pure_alloc (size_t size, int type) | |||
| 5178 | { | 5173 | { |
| 5179 | /* Allocate space for a Lisp object from the beginning of the free | 5174 | /* Allocate space for a Lisp object from the beginning of the free |
| 5180 | space with taking account of alignment. */ | 5175 | space with taking account of alignment. */ |
| 5181 | result = ALIGN (purebeg + pure_bytes_used_lisp, GCALIGNMENT); | 5176 | result = pointer_align (purebeg + pure_bytes_used_lisp, GCALIGNMENT); |
| 5182 | pure_bytes_used_lisp = ((char *)result - (char *)purebeg) + size; | 5177 | pure_bytes_used_lisp = ((char *)result - (char *)purebeg) + size; |
| 5183 | } | 5178 | } |
| 5184 | else | 5179 | else |