diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-05-07 23:23:36 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-05-07 23:23:36 +0900 |
| commit | c95279c6bfa100b40f40de7b9e8b847ba7a3b02d (patch) | |
| tree | 7ce60f71797d6795efac7f38adc1250e45b3833c /src/pool.c | |
| parent | b45c8b8d03db698c3df60dba95e8a446cb3c10c6 (diff) | |
| download | mruby-c95279c6bfa100b40f40de7b9e8b847ba7a3b02d.tar.gz mruby-c95279c6bfa100b40f40de7b9e8b847ba7a3b02d.zip | |
rename ALIGN macros
Diffstat (limited to 'src/pool.c')
| -rw-r--r-- | src/pool.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pool.c b/src/pool.c index 374bc19f9..adcf3b6b5 100644 --- a/src/pool.c +++ b/src/pool.c @@ -17,10 +17,10 @@ #define POOL_PAGE_SIZE 16000 -#ifdef ALLOC_PADDING -# define CALC_ALIGN_PADDING(x) ((x % ALLOC_PADDING) ? ALLOC_PADDING - (x % ALLOC_PADDING) : 0) +#ifdef ALLOC_ALIGN +# define ALIGN_PADDING(x) ((x % ALLOC_ALIGN) ? ALLOC_ALIGN - (x % ALLOC_ALLOC) : 0) #else -# define CALC_ALIGN_PADDING(x) (0) +# define ALIGN_PADDING(x) (0) #endif mrb_pool* @@ -74,7 +74,7 @@ mrb_pool_alloc(mrb_pool *pool, size_t len) size_t n; if (!pool) return 0; - len += CALC_ALIGN_PADDING(len); + len += ALIGN_PADDING(len); page = pool->pages; while (page) { if (page->offset + len <= page->len) { @@ -101,7 +101,7 @@ mrb_pool_can_realloc(mrb_pool *pool, void *p, size_t len) struct mrb_pool_page *page; if (!pool) return 0; - len += CALC_ALIGN_PADDING(len); + len += ALIGN_PADDING(len); page = pool->pages; while (page) { if (page->last == p) { @@ -123,8 +123,8 @@ mrb_pool_realloc(mrb_pool *pool, void *p, size_t oldlen, size_t newlen) void *np; if (!pool) return 0; - oldlen += CALC_ALIGN_PADDING(oldlen); - newlen += CALC_ALIGN_PADDING(newlen); + oldlen += ALIGN_PADDING(oldlen); + newlen += ALIGN_PADDING(newlen); page = pool->pages; while (page) { if (page->last == p) { |
