stack_frames 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c404f9278a85b107921a9ecb3fce96b487843140922499441eaf01f6615955c1
4
- data.tar.gz: daf9693bff25c25e07c0cbf169b04f56e3b716888ae3c501a031e997e275963a
3
+ metadata.gz: 2238db3a0eba08ae5a8faa43f18e315b5f8be27d5758429d6c168aa2017375fc
4
+ data.tar.gz: 70ef59c3d901559ffd7137a7720b5d921b511c8a68162de29b8ff8c3fba1b8bd
5
5
  SHA512:
6
- metadata.gz: c62e52062931e7e5e288a30bfa9524584146e198f2f5f9466f9e9d1fc8ade8cc8d2b2e70c108de426844036f25a3fa516d575fae7f3ba38529c2a463f07823ed
7
- data.tar.gz: ce7b41fd1c8ca4eccba5535ab3efaef3d29e412d7a55bb53fdac3b634354dcf56d5928e4627160d048fedf8a15db39b5f67666a0d7566c00d16de790debd729c
6
+ metadata.gz: ea5b8152852b6afade78b89c96b875d3d0585055c549ff07eb8e9d9eefe1614e71e4e69098793766397a8471a24dbd53a0c37298c02ea3fa5822b187c826c8ad
7
+ data.tar.gz: c29732481c3a7f4d198cdd26265f2b680b300d74e419f3a6c319b98420dffaf62b9750fc39c2e68ea31ef6a9d0358238ec650eb6df801082f6ffacbb4c949293
@@ -14,6 +14,7 @@ jobs:
14
14
  '2.7',
15
15
  '3.0',
16
16
  '3.1',
17
+ '3.2',
17
18
  ]
18
19
  steps:
19
20
  - uses: actions/checkout@v2
@@ -22,3 +23,14 @@ jobs:
22
23
  ruby-version: ${{ matrix.ruby }}
23
24
  bundler-cache: true
24
25
  - run: bundle exec rake
26
+
27
+ valgrind:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - uses: actions/checkout@v2
31
+ - uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: '3.1'
34
+ bundler-cache: true
35
+ - run: sudo apt-get install -y valgrind
36
+ - run: bundle exec rake test:valgrind
@@ -0,0 +1,22 @@
1
+ name: Contributor License Agreement (CLA)
2
+
3
+ on:
4
+ pull_request_target:
5
+ types: [opened, synchronize]
6
+ issue_comment:
7
+ types: [created]
8
+
9
+ jobs:
10
+ cla:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ (github.event.issue.pull_request
14
+ && !github.event.issue.pull_request.merged_at
15
+ && contains(github.event.comment.body, 'signed')
16
+ )
17
+ || (github.event.pull_request && !github.event.pull_request.merged)
18
+ steps:
19
+ - uses: Shopify/shopify-cla-action@v1
20
+ with:
21
+ github-token: ${{ secrets.GITHUB_TOKEN }}
22
+ cla-token: ${{ secrets.CLA_TOKEN }}
data/Rakefile CHANGED
@@ -1,6 +1,9 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
  require 'rake/extensiontask'
4
+ require "ruby_memcheck"
5
+
6
+ RubyMemcheck.config(binary_name: "stack_frames")
4
7
 
5
8
  ENV['STACK_FRAMES_DEV'] = '1'
6
9
 
@@ -8,10 +11,14 @@ Rake::ExtensionTask.new("stack_frames") do |ext|
8
11
  ext.lib_dir = 'lib/stack_frames'
9
12
  end
10
13
 
11
- Rake::TestTask.new(test: :compile) do |t|
14
+ test_config = lambda do |t|
12
15
  t.libs << "test"
13
16
  t.libs << "lib"
14
17
  t.test_files = FileList["test/**/*_test.rb"]
15
18
  end
19
+ Rake::TestTask.new(test: :compile, &test_config)
20
+ namespace :test do
21
+ RubyMemcheck::TestTask.new(valgrind: :compile, &test_config)
22
+ end
16
23
 
17
24
  task :default => :test
@@ -33,7 +33,7 @@ static size_t buffer_memsize(const void *ptr)
33
33
  return sizeof(buffer_t);
34
34
  }
35
35
 
36
- const rb_data_type_t buffer_data_type = {
36
+ static const rb_data_type_t buffer_data_type = {
37
37
  "stack_frames_buffer",
38
38
  { buffer_mark, buffer_free, buffer_memsize, },
39
39
  NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
@@ -1,4 +1,4 @@
1
1
  require 'mkmf'
2
- $CFLAGS << ' -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers'
2
+ $CFLAGS << ' -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden'
3
3
  $CFLAGS << ' -Werror' if ENV['STACK_FRAMES_DEV']
4
4
  create_makefile("stack_frames/stack_frames")
@@ -14,18 +14,14 @@ static void frame_mark(void *ptr)
14
14
  rb_gc_mark(frame->buffer);
15
15
  }
16
16
 
17
- static void frame_free(void *ptr)
18
- {
19
- }
20
-
21
17
  static size_t frame_memsize(const void *ptr)
22
18
  {
23
19
  return sizeof(frame_t);
24
20
  }
25
21
 
26
- const rb_data_type_t frame_data_type = {
22
+ static const rb_data_type_t frame_data_type = {
27
23
  "stack_frames_frame",
28
- { frame_mark, frame_free, frame_memsize, },
24
+ { frame_mark, RUBY_DEFAULT_FREE, frame_memsize, },
29
25
  NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
30
26
  };
31
27
 
@@ -2,7 +2,7 @@
2
2
  #include "frame.h"
3
3
  #include "buffer.h"
4
4
 
5
- void Init_stack_frames() {
5
+ RUBY_FUNC_EXPORTED void Init_stack_frames(void) {
6
6
  VALUE mStackFrames = rb_define_module("StackFrames");
7
7
  stack_buffer_define(mStackFrames);
8
8
  stack_frame_define(mStackFrames);
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StackFrames
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
data/stack_frames.gemspec CHANGED
@@ -31,4 +31,5 @@ Gem::Specification.new do |spec|
31
31
  spec.add_development_dependency 'rake-compiler', '~> 1.0'
32
32
  spec.add_development_dependency "minitest", "~> 5.0"
33
33
  spec.add_development_dependency "stackprof", "~> 0.2.13"
34
+ spec.add_development_dependency "ruby_memcheck"
34
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack_frames
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Thacker-Smith
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-04 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.2.13
83
+ - !ruby/object:Gem::Dependency
84
+ name: ruby_memcheck
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  description:
84
98
  email:
85
99
  - gems@shopify.com
@@ -88,8 +102,8 @@ extensions:
88
102
  - ext/stack_frames/extconf.rb
89
103
  extra_rdoc_files: []
90
104
  files:
91
- - ".github/probots.yml"
92
105
  - ".github/workflows/ci.yml"
106
+ - ".github/workflows/cla.yml"
93
107
  - ".gitignore"
94
108
  - CODE_OF_CONDUCT.md
95
109
  - CONTRIBUTING.md
@@ -131,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
145
  - !ruby/object:Gem::Version
132
146
  version: '0'
133
147
  requirements: []
134
- rubygems_version: 3.2.20
148
+ rubygems_version: 3.3.3
135
149
  signing_key:
136
150
  specification_version: 4
137
151
  summary: Zero allocation backtraces using MRI's profile frames API
data/.github/probots.yml DELETED
@@ -1,3 +0,0 @@
1
- # .github/probots.yml
2
- enabled:
3
- - cla