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
286665c4
Commit
286665c4
authored
Mar 08, 2014
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1830 from cremno/pool-fixes
two pool fixes
parents
6f5d2342
307c356c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/pool.c
src/pool.c
+5
-4
No files found.
src/pool.c
View file @
286665c4
...
...
@@ -5,6 +5,7 @@
*/
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "mruby.h"
...
...
@@ -36,12 +37,12 @@ struct mrb_pool {
#undef TEST_POOL
#ifdef TEST_POOL
#define mrb_malloc(m,s) malloc(s)
#define mrb_malloc
_simple
(m,s) malloc(s)
#define mrb_free(m,p) free(p)
#endif
#ifdef POOL_ALIGNMENT
# define ALIGN_PADDING(x) ((
-x
) & (POOL_ALIGNMENT - 1))
# define ALIGN_PADDING(x) ((
SIZE_MAX - (x) + 1
) & (POOL_ALIGNMENT - 1))
#else
# define ALIGN_PADDING(x) (0)
#endif
...
...
@@ -49,7 +50,7 @@ struct mrb_pool {
mrb_pool
*
mrb_pool_open
(
mrb_state
*
mrb
)
{
mrb_pool
*
pool
=
(
mrb_pool
*
)
mrb_malloc
(
mrb
,
sizeof
(
mrb_pool
));
mrb_pool
*
pool
=
(
mrb_pool
*
)
mrb_malloc
_simple
(
mrb
,
sizeof
(
mrb_pool
));
if
(
pool
)
{
pool
->
mrb
=
mrb
;
...
...
@@ -81,7 +82,7 @@ page_alloc(mrb_pool *pool, size_t len)
if
(
len
<
POOL_PAGE_SIZE
)
len
=
POOL_PAGE_SIZE
;
page
=
(
struct
mrb_pool_page
*
)
mrb_malloc
(
pool
->
mrb
,
sizeof
(
struct
mrb_pool_page
)
+
len
);
page
=
(
struct
mrb_pool_page
*
)
mrb_malloc
_simple
(
pool
->
mrb
,
sizeof
(
struct
mrb_pool_page
)
+
len
);
if
(
page
)
{
page
->
offset
=
0
;
page
->
len
=
len
;
...
...
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