Commit 269592a8 by Neil Booth Committed by Neil Booth

cpphash.h: Rename _ALIGN POOL_ALIGN.

        * cpphash.h: Rename _ALIGN POOL_ALIGN.
        * cpplex.c (new_chunk, _cpp_pool_reserve): Update.

From-SVN: r39434
parent 2da6090f
2001-02-03 Neil Booth <neil@daikokuya.demon.co.uk> 2001-02-03 Neil Booth <neil@daikokuya.demon.co.uk>
* cpphash.h: Rename _ALIGN POOL_ALIGN.
* cpplex.c (new_chunk, _cpp_pool_reserve): Update.
2001-02-03 Neil Booth <neil@daikokuya.demon.co.uk>
* cpphash.h: Rename ALIGN _ALIGN. * cpphash.h: Rename ALIGN _ALIGN.
* cpplex.c (new_chunk, _cpp_pool_reserve): Update. * cpplex.c (new_chunk, _cpp_pool_reserve): Update.
......
...@@ -43,14 +43,15 @@ struct htab; ...@@ -43,14 +43,15 @@ struct htab;
#define CPP_STACK_MAX 200 #define CPP_STACK_MAX 200
/* Memory pools. */ /* Memory pools. */
#define _ALIGN(size, align) (((size) + ((align) - 1)) & ~((align) - 1)) #define POOL_ALIGN(size, align) (((size) + ((align) - 1)) & ~((align) - 1))
#define POOL_FRONT(p) ((p)->cur->front) #define POOL_FRONT(p) ((p)->cur->front)
#define POOL_LIMIT(p) ((p)->cur->limit) #define POOL_LIMIT(p) ((p)->cur->limit)
#define POOL_BASE(p) ((p)->cur->base) #define POOL_BASE(p) ((p)->cur->base)
#define POOL_SIZE(p) ((p)->cur->limit - (p)->cur->base) #define POOL_SIZE(p) ((p)->cur->limit - (p)->cur->base)
#define POOL_ROOM(p) ((p)->cur->limit - (p)->cur->front) #define POOL_ROOM(p) ((p)->cur->limit - (p)->cur->front)
#define POOL_USED(p) ((p)->cur->front - (p)->cur->base) #define POOL_USED(p) ((p)->cur->front - (p)->cur->base)
#define POOL_COMMIT(p, len) do {((p)->cur->front += _ALIGN (len, (p)->align));\ #define POOL_COMMIT(p, len) do {\
((p)->cur->front += POOL_ALIGN (len, (p)->align));\
if ((p)->cur->front > (p)->cur->limit) abort ();} while (0) if ((p)->cur->front > (p)->cur->limit) abort ();} while (0)
typedef struct cpp_chunk cpp_chunk; typedef struct cpp_chunk cpp_chunk;
......
...@@ -1759,7 +1759,7 @@ new_chunk (size) ...@@ -1759,7 +1759,7 @@ new_chunk (size)
unsigned char *base; unsigned char *base;
cpp_chunk *result; cpp_chunk *result;
size = _ALIGN (size, DEFAULT_ALIGNMENT); size = POOL_ALIGN (size, DEFAULT_ALIGNMENT);
base = (unsigned char *) xmalloc (size + sizeof (cpp_chunk)); base = (unsigned char *) xmalloc (size + sizeof (cpp_chunk));
/* Put the chunk descriptor at the end. Then chunk overruns will /* Put the chunk descriptor at the end. Then chunk overruns will
cause obvious chaos. */ cause obvious chaos. */
...@@ -1826,7 +1826,7 @@ _cpp_pool_reserve (pool, len) ...@@ -1826,7 +1826,7 @@ _cpp_pool_reserve (pool, len)
cpp_pool *pool; cpp_pool *pool;
unsigned int len; unsigned int len;
{ {
len = _ALIGN (len, pool->align); len = POOL_ALIGN (len, pool->align);
if (len > (unsigned int) POOL_ROOM (pool)) if (len > (unsigned int) POOL_ROOM (pool))
_cpp_next_chunk (pool, len, 0); _cpp_next_chunk (pool, len, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment