rblineprof 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/ext/extconf.rb +1 -1
- data/ext/rblineprof.c +9 -3
- data/rblineprof.gemspec +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e32fff335407e85396bea5d04478a67e15a6c44b
|
4
|
+
data.tar.gz: 2a1b9e3ecfb851901cd964b87e0945fb6cbeb48a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fba6f835bfe08ce70783157c090b32c3ad757f7458ca2c1534f217711ab366a4dd9c8bf9c1a5bc46256f32300fb2a00b85f0999a41b48db3872422a168eb49a8
|
7
|
+
data.tar.gz: 277aa1eb590848b8118c5f5f2970a1d9299b2b4b3ddcbc228507c848836f6524d6b770127e32382bc40dc658c9c30208954d6f6acc0807b27cf168717a9754aa
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2012 Aman Gupta
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/ext/extconf.rb
CHANGED
@@ -14,7 +14,7 @@ elsif RUBY_VERSION >= "1.9"
|
|
14
14
|
have_type("rb_iseq_location_t", "vm_core.h")
|
15
15
|
|
16
16
|
have_header("vm_core.h") and
|
17
|
-
have_header("iseq.h")
|
17
|
+
(have_header("iseq.h") or have_header("iseq.h", ["vm_core.h"]))
|
18
18
|
}
|
19
19
|
|
20
20
|
unless Debugger::RubyCoreSource::create_makefile_with_core(hdrs, "rblineprof")
|
data/ext/rblineprof.c
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#include <ruby.h>
|
2
|
+
#include <ruby/version.h>
|
2
3
|
#include <stdbool.h>
|
3
4
|
#include <time.h>
|
4
5
|
#include <sys/time.h>
|
@@ -33,7 +34,7 @@ size_t rb_os_allocated_objects(void);
|
|
33
34
|
#endif
|
34
35
|
|
35
36
|
static VALUE gc_hook;
|
36
|
-
static VALUE
|
37
|
+
static VALUE sym_total_allocated_objects;
|
37
38
|
|
38
39
|
/*
|
39
40
|
* Time in microseconds
|
@@ -357,6 +358,7 @@ profiler_hook(rb_event_flag_t event, NODE *node, VALUE self, ID mid, VALUE klass
|
|
357
358
|
int lines[2];
|
358
359
|
int i = 0, l, n = rb_profile_frames(0, 2, iseqs, lines);
|
359
360
|
|
361
|
+
if (n == 0) return;
|
360
362
|
if (mid == 0 && n == 2) /* skip empty frame on method definition line */
|
361
363
|
i = 1;
|
362
364
|
|
@@ -418,7 +420,7 @@ profiler_hook(rb_event_flag_t event, NODE *node, VALUE self, ID mid, VALUE klass
|
|
418
420
|
#if defined(HAVE_RB_OS_ALLOCATED_OBJECTS)
|
419
421
|
.allocated_objects = rb_os_allocated_objects()
|
420
422
|
#elif defined(HAVE_RB_GC_STAT)
|
421
|
-
.allocated_objects = rb_gc_stat(
|
423
|
+
.allocated_objects = rb_gc_stat(sym_total_allocated_objects)
|
422
424
|
#endif
|
423
425
|
};
|
424
426
|
|
@@ -672,7 +674,11 @@ rblineprof_gc_mark()
|
|
672
674
|
void
|
673
675
|
Init_rblineprof()
|
674
676
|
{
|
675
|
-
|
677
|
+
#if RUBY_API_VERSION_MAJOR == 2 && RUBY_API_VERSION_MINOR < 2
|
678
|
+
sym_total_allocated_objects = ID2SYM(rb_intern("total_allocated_object"));
|
679
|
+
#else
|
680
|
+
sym_total_allocated_objects = ID2SYM(rb_intern("total_allocated_objects"));
|
681
|
+
#endif
|
676
682
|
gc_hook = Data_Wrap_Struct(rb_cObject, rblineprof_gc_mark, NULL, NULL);
|
677
683
|
rb_global_variable(&gc_hook);
|
678
684
|
|
data/rblineprof.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rblineprof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aman Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debugger-ruby_core_source
|
@@ -48,6 +48,7 @@ files:
|
|
48
48
|
- ".gitignore"
|
49
49
|
- Gemfile
|
50
50
|
- Gemfile.lock
|
51
|
+
- LICENSE
|
51
52
|
- README.md
|
52
53
|
- Rakefile
|
53
54
|
- ext/.gitignore
|
@@ -76,8 +77,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
77
|
version: '0'
|
77
78
|
requirements: []
|
78
79
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
80
|
+
rubygems_version: 2.4.5.1
|
80
81
|
signing_key:
|
81
82
|
specification_version: 4
|
82
83
|
summary: line-profiler for ruby
|
83
84
|
test_files: []
|
85
|
+
has_rdoc:
|