diff options
-rw-r--r-- | .travis.yml | 3 | ||||
-rw-r--r-- | Rakefile | 4 | ||||
-rw-r--r-- | ext/psych/psych_emitter.c | 5 | ||||
-rw-r--r-- | ext/psych/psych_parser.c | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index 6cfdb72..7665cae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,13 @@ rvm: - 1.9.3 - 2.0.0 - 2.1.0 + - 2.2.0 - ruby-head - rbx-2 before_script: - gem install hoe - gem install rake-compiler - - gem install minitest -v '~> 4.0' + - gem install minitest -v '~> 5.0' script: rake test matrix: allow_failures: @@ -16,7 +16,7 @@ class Hoe end gem 'rake-compiler', '>= 0.4.1' -gem 'minitest', '~> 4.0' +gem 'minitest', '~> 5.0' require "rake/extensiontask" Hoe.plugin :doofus, :git, :gemspec @@ -31,7 +31,7 @@ $hoe = Hoe.spec 'psych' do self.testlib = :minitest extra_dev_deps << ['rake-compiler', '>= 0.4.1'] - extra_dev_deps << ['minitest', '~> 4.0'] + extra_dev_deps << ['minitest', '~> 5.0'] self.spec_extras = { :required_ruby_version => '>= 1.9.2' diff --git a/ext/psych/psych_emitter.c b/ext/psych/psych_emitter.c index 4ba2381..feffc54 100644 --- a/ext/psych/psych_emitter.c +++ b/ext/psych/psych_emitter.c @@ -50,14 +50,13 @@ static const rb_data_type_t psych_emitter_type = { static VALUE allocate(VALUE klass) { yaml_emitter_t * emitter; - - emitter = xmalloc(sizeof(yaml_emitter_t)); + VALUE obj = TypedData_Make_Struct(klass, yaml_emitter_t, &psych_emitter_type, emitter); yaml_emitter_initialize(emitter); yaml_emitter_set_unicode(emitter, 1); yaml_emitter_set_indent(emitter, 2); - return TypedData_Wrap_Struct(klass, &psych_emitter_type, emitter); + return obj; } /* call-seq: Psych::Emitter.new(io, options = Psych::Emitter::OPTIONS) diff --git a/ext/psych/psych_parser.c b/ext/psych/psych_parser.c index faae460..2caa8a0 100644 --- a/ext/psych/psych_parser.c +++ b/ext/psych/psych_parser.c @@ -70,11 +70,11 @@ static const rb_data_type_t psych_parser_type = { static VALUE allocate(VALUE klass) { yaml_parser_t * parser; + VALUE obj = TypedData_Make_Struct(klass, yaml_parser_t, &psych_parser_type, parser); - parser = xmalloc(sizeof(yaml_parser_t)); yaml_parser_initialize(parser); - return TypedData_Wrap_Struct(klass, &psych_parser_type, parser); + return obj; } static VALUE make_exception(yaml_parser_t * parser, VALUE path) |