allocations 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -6
- data/ext/liballocations/liballocations.c +5 -1
- data/lib/allocations/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f684c28383cf0174b1410aacedd436771f14603
|
4
|
+
data.tar.gz: c8cb8d726e5edbe6a81005c65ffce812a4688c6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f17e896bcb848cbbcc59cf5bee39ba3baf318eb995bacf90df28b654143b07a2670a1c55f6e692ac7475f67515783987b56614af01804e70799dc4f6e926f45c
|
7
|
+
data.tar.gz: 325c979378375a49ac0d233abc3cd1bea91b903765dcd9fe7c66a34e52e9b1dd7b01e08fb675179c814f830409cab05d5f4fad51fb7bae9dfddff9758df59239
|
data/README.md
CHANGED
@@ -56,12 +56,9 @@ Disable it again and clear any existing statistics:
|
|
56
56
|
|
57
57
|
## Thread Safety
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
`
|
62
|
-
statistics (instead of just referring to a single global Hash).
|
63
|
-
|
64
|
-
Do note that calling `Allocation.start` and `Allocations.stop` affects _all_
|
59
|
+
This C extension does not use any internal locking and instead relies on the GIL
|
60
|
+
to prevent multiple Ruby threads from accessing the allocation data in parallel.
|
61
|
+
Note that calling `Allocation.start` and `Allocations.stop` also affects _all_
|
65
62
|
running threads instead of only the current thread.
|
66
63
|
|
67
64
|
## License
|
@@ -56,7 +56,11 @@ void freeobj_callback(VALUE tracepoint, void* data) {
|
|
56
56
|
* Copies every value in an st_table to a given Ruby Hash.
|
57
57
|
*/
|
58
58
|
static int each_count(st_data_t key, st_data_t value, st_data_t hash_ptr) {
|
59
|
-
|
59
|
+
VALUE vkey = (VALUE) key;
|
60
|
+
|
61
|
+
if ( rb_obj_is_kind_of(key, rb_cClass) == Qtrue ) {
|
62
|
+
rb_hash_aset((VALUE) hash_ptr, vkey, INT2NUM(value));
|
63
|
+
}
|
60
64
|
|
61
65
|
return ST_CONTINUE;
|
62
66
|
}
|
data/lib/allocations/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: allocations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yorick Peterse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.5.1
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Tracking of retained objects in CRuby
|