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
f868d7d3
Unverified
Commit
f868d7d3
authored
Jul 24, 2020
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change the logic to calculate object (`iv_tbl`) size; #5045
parent
c69ca2c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
src/variable.c
src/variable.c
+10
-3
No files found.
src/variable.c
View file @
f868d7d3
...
...
@@ -1131,9 +1131,16 @@ mrb_class_find_path(mrb_state *mrb, struct RClass *c)
mrb_int
mrb_obj_iv_tbl_memsize
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
size_t
ivsize
=
iv_size
(
mrb
,
mrb_obj_ptr
(
obj
)
->
iv
);
size_t
ivsegs
=
(
ivsize
+
MRB_IV_SEGMENT_SIZE
-
1
)
/
MRB_IV_SEGMENT_SIZE
;
return
sizeof
(
iv_tbl
)
+
(
sizeof
(
segment
)
*
ivsegs
);
size_t
nseg
=
0
;
segment
*
seg
;
if
(
mrb_obj_ptr
(
obj
)
->
iv
==
NULL
)
return
0
;
seg
=
mrb_obj_ptr
(
obj
)
->
iv
->
rootseg
;
while
(
seg
)
{
nseg
++
;
seg
=
seg
->
next
;
}
return
sizeof
(
iv_tbl
)
+
sizeof
(
segment
)
*
nseg
;
}
#define identchar(c) (ISALNUM(c) || (c) == '_' || !ISASCII(c))
...
...
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