diff --git a/ChangeLog b/ChangeLog index c2b62fd5f7..1a7df151a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -Sat Aug 14 15:11:01 2010 Nobuyoshi Nakada +Sat Aug 14 15:17:36 2010 Nobuyoshi Nakada + + * 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 32b5b1ee41..b557cc9ab3 100644 --- a/ext/objspace/objspace.c +++ b/ext/objspace/objspace.c @@ -29,11 +29,11 @@ #include #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 b681e669bf..ef4c086242 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 c0c0e99815..633cd885c6 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