Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
c95279c6
Commit
c95279c6
authored
May 07, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename ALIGN macros
parent
b45c8b8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
src/pool.c
src/pool.c
+7
-7
No files found.
src/pool.c
View file @
c95279c6
...
@@ -17,10 +17,10 @@
...
@@ -17,10 +17,10 @@
#define POOL_PAGE_SIZE 16000
#define POOL_PAGE_SIZE 16000
#ifdef ALLOC_
PADDING
#ifdef ALLOC_
ALIGN
# define
CALC_ALIGN_PADDING(x) ((x % ALLOC_PADDING) ? ALLOC_PADDING - (x % ALLOC_PADDING
) : 0)
# define
ALIGN_PADDING(x) ((x % ALLOC_ALIGN) ? ALLOC_ALIGN - (x % ALLOC_ALLOC
) : 0)
#else
#else
# define
CALC_
ALIGN_PADDING(x) (0)
# define ALIGN_PADDING(x) (0)
#endif
#endif
mrb_pool
*
mrb_pool
*
...
@@ -74,7 +74,7 @@ mrb_pool_alloc(mrb_pool *pool, size_t len)
...
@@ -74,7 +74,7 @@ mrb_pool_alloc(mrb_pool *pool, size_t len)
size_t
n
;
size_t
n
;
if
(
!
pool
)
return
0
;
if
(
!
pool
)
return
0
;
len
+=
CALC_
ALIGN_PADDING
(
len
);
len
+=
ALIGN_PADDING
(
len
);
page
=
pool
->
pages
;
page
=
pool
->
pages
;
while
(
page
)
{
while
(
page
)
{
if
(
page
->
offset
+
len
<=
page
->
len
)
{
if
(
page
->
offset
+
len
<=
page
->
len
)
{
...
@@ -101,7 +101,7 @@ mrb_pool_can_realloc(mrb_pool *pool, void *p, size_t len)
...
@@ -101,7 +101,7 @@ mrb_pool_can_realloc(mrb_pool *pool, void *p, size_t len)
struct
mrb_pool_page
*
page
;
struct
mrb_pool_page
*
page
;
if
(
!
pool
)
return
0
;
if
(
!
pool
)
return
0
;
len
+=
CALC_
ALIGN_PADDING
(
len
);
len
+=
ALIGN_PADDING
(
len
);
page
=
pool
->
pages
;
page
=
pool
->
pages
;
while
(
page
)
{
while
(
page
)
{
if
(
page
->
last
==
p
)
{
if
(
page
->
last
==
p
)
{
...
@@ -123,8 +123,8 @@ mrb_pool_realloc(mrb_pool *pool, void *p, size_t oldlen, size_t newlen)
...
@@ -123,8 +123,8 @@ mrb_pool_realloc(mrb_pool *pool, void *p, size_t oldlen, size_t newlen)
void
*
np
;
void
*
np
;
if
(
!
pool
)
return
0
;
if
(
!
pool
)
return
0
;
oldlen
+=
CALC_
ALIGN_PADDING
(
oldlen
);
oldlen
+=
ALIGN_PADDING
(
oldlen
);
newlen
+=
CALC_
ALIGN_PADDING
(
newlen
);
newlen
+=
ALIGN_PADDING
(
newlen
);
page
=
pool
->
pages
;
page
=
pool
->
pages
;
while
(
page
)
{
while
(
page
)
{
if
(
page
->
last
==
p
)
{
if
(
page
->
last
==
p
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment