summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-14 06:17:38 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-08-14 06:17:38 +0000
commita979eb4548bf8b8d7479ba83e4a2f25f77175f4d (patch)
tree2ab1a2840c323ba983570b63f3ecce71cddfec25
parent23b1a3d3fa8ec7d5e6f4d9f89540207682502c66 (diff)
* regcomp.c (onig_memsize): constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--ext/objspace/objspace.c2
-rw-r--r--regcomp.c2
-rw-r--r--regint.h2
4 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index c2b62fd..1a7df15 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
-Sat Aug 14 15:11:01 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Aug 14 15:17:36 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * regcomp.c (onig_memsize): constified.
* gc.h (rb_objspace_each_objects): used in objspace.
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index 32b5b1e..b557cc9 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -29,11 +29,11 @@
#include <ruby/re.h>
#include <../../node.h>
#include <../../gc.h>
+#include <../../regint.h>
size_t rb_str_memsize(VALUE);
size_t rb_ary_memsize(VALUE);
size_t rb_io_memsize(rb_io_t *);
-size_t onig_memsize(regex_t *);
size_t rb_generic_ivar_memsize(VALUE);
size_t rb_objspace_data_type_memsize(VALUE obj);
diff --git a/regcomp.c b/regcomp.c
index b681e66..ef4c086 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5249,7 +5249,7 @@ onig_free(regex_t* reg)
}
size_t
-onig_memsize(regex_t *reg)
+onig_memsize(const regex_t *reg)
{
size_t size = sizeof(regex_t);
if (IS_NOT_NULL(reg->p)) size += reg->alloc;
diff --git a/regint.h b/regint.h
index c0c0e99..633cd88 100644
--- a/regint.h
+++ b/regint.h
@@ -842,6 +842,8 @@ typedef int (*ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE)(void);
extern int onigenc_property_list_init P_((ONIGENC_INIT_PROPERTY_LIST_FUNC_TYPE));
+extern size_t onig_memsize P_((const regex_t *reg));
+
#if defined __GNUC__ && __GNUC__ >= 4
#pragma GCC visibility pop
#endif