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
9bfc64b4
Commit
9bfc64b4
authored
Jul 31, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:mruby/mruby
parents
e064ff20
954c33a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
include/mrbconf.h
include/mrbconf.h
+6
-0
src/array.c
src/array.c
+2
-2
src/pool.c
src/pool.c
+1
-1
No files found.
include/mrbconf.h
View file @
9bfc64b4
...
@@ -25,6 +25,12 @@
...
@@ -25,6 +25,12 @@
/* default size of khash table bucket */
/* default size of khash table bucket */
//#define KHASH_DEFAULT_SIZE 32
//#define KHASH_DEFAULT_SIZE 32
/* allocated memory address alignment */
//#define POOL_ALIGNMENT 4
/* page size of memory pool */
//#define POOL_PAGE_SIZE 16000
/* -DDISABLE_XXXX to drop the feature */
/* -DDISABLE_XXXX to drop the feature */
#define DISABLE_REGEXP
/* regular expression classes */
#define DISABLE_REGEXP
/* regular expression classes */
//#define DISABLE_SPRINTF /* Kernel.sprintf method */
//#define DISABLE_SPRINTF /* Kernel.sprintf method */
...
...
src/array.c
View file @
9bfc64b4
...
@@ -682,10 +682,10 @@ mrb_ary_aget(mrb_state *mrb, mrb_value self)
...
@@ -682,10 +682,10 @@ mrb_ary_aget(mrb_state *mrb, mrb_value self)
if
(
mrb_type
(
argv
[
0
])
!=
MRB_TT_FIXNUM
)
{
if
(
mrb_type
(
argv
[
0
])
!=
MRB_TT_FIXNUM
)
{
mrb_raise
(
mrb
,
E_TYPE_ERROR
,
"expected Fixnum"
);
mrb_raise
(
mrb
,
E_TYPE_ERROR
,
"expected Fixnum"
);
}
}
len
=
mrb_fixnum
(
argv
[
0
]);
if
(
index
<
0
)
index
+=
a
->
len
;
if
(
index
<
0
)
index
+=
a
->
len
;
if
(
index
<
0
||
a
->
len
<
(
int
)
index
)
return
mrb_nil_value
();
if
(
index
<
0
||
a
->
len
<
(
int
)
index
)
return
mrb_nil_value
();
if
((
len
=
mrb_fixnum
(
argv
[
0
]))
<
0
)
return
mrb_nil_value
();
len
=
mrb_fixnum
(
argv
[
0
]);
if
(
len
<
0
)
return
mrb_nil_value
();
if
(
a
->
len
==
(
int
)
index
)
return
mrb_ary_new
(
mrb
);
if
(
a
->
len
==
(
int
)
index
)
return
mrb_ary_new
(
mrb
);
if
((
int
)
len
>
a
->
len
-
index
)
len
=
a
->
len
-
index
;
if
((
int
)
len
>
a
->
len
-
index
)
len
=
a
->
len
-
index
;
return
ary_subseq
(
mrb
,
a
,
index
,
len
);
return
ary_subseq
(
mrb
,
a
,
index
,
len
);
...
...
src/pool.c
View file @
9bfc64b4
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#include <string.h>
#include <string.h>
/* configuration section */
/* configuration section */
/* all
cated memory address should be multiple of POOL_ALLOC_ALIGN
*/
/* all
ocated memory address should be multiple of POOL_ALIGNMENT
*/
/* or undef it if alignment does not matter */
/* or undef it if alignment does not matter */
#ifndef POOL_ALIGNMENT
#ifndef POOL_ALIGNMENT
#define POOL_ALIGNMENT 4
#define POOL_ALIGNMENT 4
...
...
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