Skip to content

Commit 6d675e2

Browse files
authored
Merge pull request #40 from increments/merge-upstream-v0.23.9
Merge upstream v0.23.9
2 parents be76074 + 63a84b2 commit 6d675e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+14861
-10845
lines changed

.github/workflows/lint.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: Linting
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
6-
push:
7-
branches:
8-
- main
95

106
jobs:
117
test:
@@ -14,7 +10,7 @@ jobs:
1410
- uses: actions/checkout@v2
1511
- uses: ruby/setup-ruby@v1
1612
with:
17-
ruby-version: 3.0
13+
ruby-version: '3.0'
1814
bundler-cache: true # 'bundle install' and cache
1915
- name: Rubocop
2016
run: bundle exec rake rubocop

.github/workflows/tag_and_release.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Tag and Release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- c-api-stable
8+
paths:
9+
- "lib/qiita_marker/version.rb"
10+
11+
jobs:
12+
c_gem:
13+
name: Compile C gem
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set up Ruby
20+
uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: 3.1
23+
bundler-cache: true
24+
25+
- name: Compile gem
26+
run: bundle exec rake compile
27+
28+
- name: Build gem
29+
run: bundle exec rake build
30+
31+
- name: Display structure of built gems
32+
run: ls -R
33+
working-directory: pkg/
34+
35+
- name: Publish to RubyGems
36+
working-directory: pkg/
37+
env:
38+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_API_BOT_KEY}}
39+
run: |
40+
mkdir -p $HOME/.gem
41+
touch $HOME/.gem/credentials
42+
chmod 0600 $HOME/.gem/credentials
43+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
44+
for i in *.gem; do
45+
if [ -f "$i" ]
46+
then
47+
gem push "$i" || true
48+
fi
49+
done
50+
51+
release:
52+
needs: ["c_gem"]
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v3
58+
59+
- name: Set up Ruby 3.1
60+
uses: ruby/setup-ruby@v1
61+
with:
62+
rubygems: latest
63+
ruby-version: 3.1
64+
bundler-cache: true
65+
66+
- name: Configure Git
67+
run: |
68+
git config --local user.email "actions@github.com"
69+
git config --local user.name "Actions Auto Build"
70+
71+
- name: Get current version
72+
id: version-label
73+
run: |
74+
VERSION=$(grep VERSION lib/qiita_marker/version.rb | head -n 1 | cut -d'"' -f2)
75+
echo "version=${VERSION}" >> $GITHUB_OUTPUT
76+
77+
- name: Create tag
78+
run: |
79+
git tag -a v${{ steps.version-label.outputs.version }} -m "Release v${{ steps.version-label.outputs.version }}"
80+
git push origin --tags
81+
82+
- name: Publish release
83+
env:
84+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85+
run: |
86+
gh release create v${{ steps.version-label.outputs.version }} --generate-notes

.github/workflows/test.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: CI
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened]
6-
push:
7-
branches:
8-
- production
95

106
jobs:
117
test:
@@ -16,7 +12,7 @@ jobs:
1612
- ubuntu-latest
1713
- macos-latest
1814
- windows-latest
19-
ruby-version: [3.1, 3.0.0, 2.7.2]
15+
ruby-version: [3.1, 3.0.6]
2016

2117
runs-on: ${{ matrix.os }}
2218

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inherit_gem:
66
- config/minitest.yml
77

88
AllCops:
9-
TargetRubyVersion: 2.7
9+
TargetRubyVersion: 3.0
1010
Exclude:
1111
- "ext/**/*"
1212
- "vendor/**/*"

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
### Changed
88

9+
- Update base CommonMarker version to `v0.23.9`.
10+
- Drop Ruby 2.7 support
11+
912
## 0.23.6.2 - 2022-11-18
1013

1114
### Changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ruby:2.7.2
1+
FROM ruby:3.0.6
22

33
ENV RE2C_VERSION 1.3
44

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,3 @@ ext/qiita_marker/cmark-gfm_export.h: ext/qiita_marker/cmark-upstream/build/src/c
2121

2222
ext/qiita_marker/cmark-gfm_version.h: ext/qiita_marker/cmark-upstream/build/src/cmark-gfm_version.h
2323
cp $< $@
24-
25-
ext/qiita_marker/cmark-gfm-extensions_export.h: ext/qiita_marker/cmark-upstream/build/extensions/cmark-gfm-extensions_export.h
26-
cp $< $@

ext/qiita_marker/arena.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,16 @@ static void *arena_calloc(size_t nmem, size_t size) {
6868
const size_t align = sizeof(size_t) - 1;
6969
sz = (sz + align) & ~align;
7070

71+
struct arena_chunk *chunk;
7172
if (sz > A->sz) {
72-
A->prev = alloc_arena_chunk(sz, A->prev);
73-
return (uint8_t *) A->prev->ptr + sizeof(size_t);
73+
A->prev = chunk = alloc_arena_chunk(sz, A->prev);
74+
} else if (sz > A->sz - A->used) {
75+
A = chunk = alloc_arena_chunk(A->sz + A->sz / 2, A);
76+
} else {
77+
chunk = A;
7478
}
75-
if (sz > A->sz - A->used) {
76-
A = alloc_arena_chunk(A->sz + A->sz / 2, A);
77-
}
78-
void *ptr = (uint8_t *) A->ptr + A->used;
79-
A->used += sz;
79+
void *ptr = (uint8_t *) chunk->ptr + chunk->used;
80+
chunk->used += sz;
8081
*((size_t *) ptr) = sz - sizeof(size_t);
8182
return (uint8_t *) ptr + sizeof(size_t);
8283
}
@@ -98,6 +99,6 @@ static void arena_free(void *ptr) {
9899

99100
cmark_mem CMARK_ARENA_MEM_ALLOCATOR = {arena_calloc, arena_realloc, arena_free};
100101

101-
cmark_mem *cmark_get_arena_mem_allocator() {
102+
cmark_mem *cmark_get_arena_mem_allocator(void) {
102103
return &CMARK_ARENA_MEM_ALLOCATOR;
103104
}

0 commit comments

Comments
 (0)