markly 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/conduct.md +133 -0
  4. data/ext/markly/Makefile +270 -0
  5. data/ext/markly/arena.c +9 -8
  6. data/ext/markly/arena.o +0 -0
  7. data/ext/markly/autolink.c +217 -134
  8. data/ext/markly/autolink.o +0 -0
  9. data/ext/markly/blocks.c +27 -2
  10. data/ext/markly/blocks.o +0 -0
  11. data/ext/markly/buffer.o +0 -0
  12. data/ext/markly/cmark-gfm-core-extensions.h +11 -11
  13. data/ext/markly/cmark-gfm-extension_api.h +1 -0
  14. data/ext/markly/cmark-gfm.h +18 -2
  15. data/ext/markly/cmark.c +3 -3
  16. data/ext/markly/cmark.o +0 -0
  17. data/ext/markly/cmark_ctype.o +0 -0
  18. data/ext/markly/commonmark.c +19 -34
  19. data/ext/markly/commonmark.o +0 -0
  20. data/ext/markly/core-extensions.o +0 -0
  21. data/ext/markly/ext_scanners.o +0 -0
  22. data/ext/markly/extconf.rb +8 -1
  23. data/ext/markly/footnotes.o +0 -0
  24. data/ext/markly/houdini_href_e.o +0 -0
  25. data/ext/markly/houdini_html_e.o +0 -0
  26. data/ext/markly/houdini_html_u.o +0 -0
  27. data/ext/markly/html.c +22 -6
  28. data/ext/markly/html.o +0 -0
  29. data/ext/markly/inlines.c +148 -51
  30. data/ext/markly/inlines.o +0 -0
  31. data/ext/markly/iterator.o +0 -0
  32. data/ext/markly/latex.c +6 -4
  33. data/ext/markly/latex.o +0 -0
  34. data/ext/markly/linked_list.o +0 -0
  35. data/ext/markly/man.c +7 -11
  36. data/ext/markly/man.o +0 -0
  37. data/ext/markly/map.c +11 -4
  38. data/ext/markly/map.h +5 -2
  39. data/ext/markly/map.o +0 -0
  40. data/ext/markly/markly.bundle +0 -0
  41. data/ext/markly/markly.c +582 -586
  42. data/ext/markly/markly.h +1 -1
  43. data/ext/markly/markly.o +0 -0
  44. data/ext/markly/node.c +76 -10
  45. data/ext/markly/node.h +42 -1
  46. data/ext/markly/node.o +0 -0
  47. data/ext/markly/parser.h +1 -0
  48. data/ext/markly/plaintext.c +12 -29
  49. data/ext/markly/plaintext.o +0 -0
  50. data/ext/markly/plugin.o +0 -0
  51. data/ext/markly/references.c +1 -0
  52. data/ext/markly/references.o +0 -0
  53. data/ext/markly/registry.o +0 -0
  54. data/ext/markly/render.c +15 -7
  55. data/ext/markly/render.o +0 -0
  56. data/ext/markly/scanners.c +13916 -10380
  57. data/ext/markly/scanners.h +8 -0
  58. data/ext/markly/scanners.o +0 -0
  59. data/ext/markly/scanners.re +47 -8
  60. data/ext/markly/strikethrough.c +1 -1
  61. data/ext/markly/strikethrough.o +0 -0
  62. data/ext/markly/syntax_extension.o +0 -0
  63. data/ext/markly/table.c +81 -31
  64. data/ext/markly/table.o +0 -0
  65. data/ext/markly/tagfilter.o +0 -0
  66. data/ext/markly/tasklist.o +0 -0
  67. data/ext/markly/utf8.o +0 -0
  68. data/ext/markly/xml.c +2 -1
  69. data/ext/markly/xml.o +0 -0
  70. data/lib/markly/flags.rb +16 -0
  71. data/lib/markly/node/inspect.rb +59 -53
  72. data/lib/markly/node.rb +125 -58
  73. data/lib/markly/renderer/generic.rb +129 -124
  74. data/lib/markly/renderer/html.rb +294 -275
  75. data/lib/markly/version.rb +7 -1
  76. data/lib/markly.rb +36 -30
  77. data/license.md +39 -0
  78. data/readme.md +36 -0
  79. data.tar.gz.sig +0 -0
  80. metadata +98 -29
  81. metadata.gz.sig +0 -0
  82. data/bin/markly +0 -94
  83. data/lib/markly/markly.bundle +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e62908560f536f22b024d0fc29c02ee109a99aa6b4216d58e82fc97d7525171a
4
- data.tar.gz: b6b7eae8d1579556a4461aa9d338cb1d86433fdcb20c6ac70983d0cdedeead6e
3
+ metadata.gz: 2d10fb7a74c3c23a19491d3bc5a884e18b3f9ec86dde3a15dc2948fe1e66bb99
4
+ data.tar.gz: 56a61a7482fa7890c4d38134a0981e72aa1e982ffce32e25172d815bae318748
5
5
  SHA512:
6
- metadata.gz: daee4db1b759180ea27886da828fa1301aac0adb1833203b80b635ee815e61bebb8caedad03853cd4d4231de748781cefa6d341d3172d3a387e170cbd806cc47
7
- data.tar.gz: a0f79ef83f73d32c8b1b14a21c13ad3c20574abed043e29cb0057c31c9b85ccb051244462efb0dfd508a3315232083de3bafefa0dc4d24fd5106bc966721bcdf
6
+ metadata.gz: 2ca598c38eb22ce671db4aacbbe91ce32e5611f7aa7d8786ea1d1198857dd6b60265607b9168c5951ba5c3b5df6437316a36378860f5ba85f0ff8e2358924491
7
+ data.tar.gz: 17c4e881fa8c69a1d7cc1b034bc609d097e46cd2c0c702a6b59c15967dedfb0720ff1851e1d5260adb73a3654681b9b59169b982a032d8aef5c14a3dc3611fcc
checksums.yaml.gz.sig ADDED
Binary file
data/conduct.md ADDED
@@ -0,0 +1,133 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, caste, color, religion, or sexual
11
+ identity and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the overall
27
+ community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or advances of
32
+ any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email address,
36
+ without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ [INSERT CONTACT METHOD].
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series of
87
+ actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or permanent
94
+ ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within the
114
+ community.
115
+
116
+ ## Attribution
117
+
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.1, available at
120
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121
+
122
+ Community Impact Guidelines were inspired by
123
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ at
126
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127
+ [https://www.contributor-covenant.org/translations][translations].
128
+
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131
+ [Mozilla CoC]: https://github.com/mozilla/diversity
132
+ [FAQ]: https://www.contributor-covenant.org/faq
133
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,270 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ # V=0 quiet, V=1 verbose. other values don't work.
5
+ V = 0
6
+ V0 = $(V:0=)
7
+ Q1 = $(V:1=)
8
+ Q = $(Q1:0=@)
9
+ ECHO1 = $(V:1=@ :)
10
+ ECHO = $(ECHO1:0=@ echo)
11
+ NULLCMD = :
12
+
13
+ #### Start of system configuration section. ####
14
+
15
+ srcdir = .
16
+ topdir = /Users/samuel/.rubies/ruby-3.2.1/include/ruby-3.2.0
17
+ hdrdir = $(topdir)
18
+ arch_hdrdir = /Users/samuel/.rubies/ruby-3.2.1/include/ruby-3.2.0/arm64-darwin22
19
+ PATH_SEPARATOR = :
20
+ VPATH = $(srcdir):$(arch_hdrdir)/ruby:$(hdrdir)/ruby
21
+ prefix = $(DESTDIR)/Users/samuel/.rubies/ruby-3.2.1
22
+ rubysitearchprefix = $(rubylibprefix)/$(sitearch)
23
+ rubyarchprefix = $(rubylibprefix)/$(arch)
24
+ rubylibprefix = $(libdir)/$(RUBY_BASE_NAME)
25
+ exec_prefix = $(prefix)
26
+ vendorarchhdrdir = $(vendorhdrdir)/$(sitearch)
27
+ sitearchhdrdir = $(sitehdrdir)/$(sitearch)
28
+ rubyarchhdrdir = $(rubyhdrdir)/$(arch)
29
+ vendorhdrdir = $(rubyhdrdir)/vendor_ruby
30
+ sitehdrdir = $(rubyhdrdir)/site_ruby
31
+ rubyhdrdir = $(includedir)/$(RUBY_VERSION_NAME)
32
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
33
+ vendorlibdir = $(vendordir)/$(ruby_version)
34
+ vendordir = $(rubylibprefix)/vendor_ruby
35
+ sitearchdir = $(sitelibdir)/$(sitearch)
36
+ sitelibdir = $(sitedir)/$(ruby_version)
37
+ sitedir = $(rubylibprefix)/site_ruby
38
+ rubyarchdir = $(rubylibdir)/$(arch)
39
+ rubylibdir = $(rubylibprefix)/$(ruby_version)
40
+ sitearchincludedir = $(includedir)/$(sitearch)
41
+ archincludedir = $(includedir)/$(arch)
42
+ sitearchlibdir = $(libdir)/$(sitearch)
43
+ archlibdir = $(libdir)/$(arch)
44
+ ridir = $(datarootdir)/$(RI_BASE_NAME)
45
+ mandir = $(datarootdir)/man
46
+ localedir = $(datarootdir)/locale
47
+ libdir = $(exec_prefix)/lib
48
+ psdir = $(docdir)
49
+ pdfdir = $(docdir)
50
+ dvidir = $(docdir)
51
+ htmldir = $(docdir)
52
+ infodir = $(datarootdir)/info
53
+ docdir = $(datarootdir)/doc/$(PACKAGE)
54
+ oldincludedir = $(DESTDIR)/usr/include
55
+ includedir = $(SDKROOT)$(prefix)/include
56
+ runstatedir = $(localstatedir)/run
57
+ localstatedir = $(prefix)/var
58
+ sharedstatedir = $(prefix)/com
59
+ sysconfdir = $(prefix)/etc
60
+ datadir = $(datarootdir)
61
+ datarootdir = $(prefix)/share
62
+ libexecdir = $(exec_prefix)/libexec
63
+ sbindir = $(exec_prefix)/sbin
64
+ bindir = $(exec_prefix)/bin
65
+ archdir = $(rubyarchdir)
66
+
67
+
68
+ CC_WRAPPER =
69
+ CC = clang
70
+ CXX = clang++
71
+ LIBRUBY = $(LIBRUBY_A)
72
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
73
+ LIBRUBYARG_SHARED =
74
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static -framework CoreFoundation $(MAINLIBS)
75
+ empty =
76
+ OUTFLAG = -o $(empty)
77
+ COUTFLAG = -o $(empty)
78
+ CSRCFLAG = $(empty)
79
+
80
+ RUBY_EXTCONF_H =
81
+ cflags = -fdeclspec $(optflags) $(debugflags) $(warnflags)
82
+ cxxflags =
83
+ optflags = -O3 -fno-fast-math
84
+ debugflags = -ggdb3
85
+ warnflags = -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wundef
86
+ cppflags =
87
+ CCDLFLAGS = -fno-common
88
+ CFLAGS = $(CCDLFLAGS) $(cflags) -pipe -O3 -std=c99 $(ARCH_FLAG)
89
+ INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir)
90
+ DEFS =
91
+ CPPFLAGS = -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT $(DEFS) $(cppflags)
92
+ CXXFLAGS = $(CCDLFLAGS) -fdeclspec $(ARCH_FLAG)
93
+ ldflags = -L. -fstack-protector-strong -L/opt/local/lib
94
+ dldflags = -L/opt/local/lib -Wl,-multiply_defined,suppress -bundle_loader '$(BUILTRUBY)'
95
+ ARCH_FLAG =
96
+ DLDFLAGS = $(ldflags) $(dldflags) $(ARCH_FLAG)
97
+ LDSHARED = $(CC) -dynamic -bundle
98
+ LDSHAREDXX = $(CXX) -dynamic -bundle
99
+ AR = ar
100
+ EXEEXT =
101
+
102
+ RUBY_INSTALL_NAME = $(RUBY_BASE_NAME)
103
+ RUBY_SO_NAME = ruby.3.2
104
+ RUBYW_INSTALL_NAME =
105
+ RUBY_VERSION_NAME = $(RUBY_BASE_NAME)-$(ruby_version)
106
+ RUBYW_BASE_NAME = rubyw
107
+ RUBY_BASE_NAME = ruby
108
+
109
+ arch = arm64-darwin22
110
+ sitearch = $(arch)
111
+ ruby_version = 3.2.0
112
+ ruby = $(bindir)/$(RUBY_BASE_NAME)
113
+ RUBY = $(ruby)
114
+ BUILTRUBY = $(bindir)/$(RUBY_BASE_NAME)
115
+ ruby_headers = $(hdrdir)/ruby.h $(hdrdir)/ruby/backward.h $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/defines.h $(hdrdir)/ruby/missing.h $(hdrdir)/ruby/intern.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/subst.h $(arch_hdrdir)/ruby/config.h
116
+
117
+ RM = rm -f
118
+ RM_RF = rm -fr
119
+ RMDIRS = rmdir -p
120
+ MAKEDIRS = /opt/local/bin/gmkdir -p
121
+ INSTALL = /opt/local/bin/ginstall -c
122
+ INSTALL_PROG = $(INSTALL) -m 0755
123
+ INSTALL_DATA = $(INSTALL) -m 644
124
+ COPY = cp
125
+ TOUCH = exit >
126
+
127
+ #### End of system configuration section. ####
128
+
129
+ preload =
130
+ libpath = . $(libdir) /opt/local/lib
131
+ LIBPATH = -L. -L$(libdir) -L/opt/local/lib
132
+ DEFFILE =
133
+
134
+ CLEANFILES = mkmf.log
135
+ DISTCLEANFILES =
136
+ DISTCLEANDIRS =
137
+
138
+ extout =
139
+ extout_prefix =
140
+ target_prefix = /markly
141
+ LOCAL_LIBS =
142
+ LIBS = -lpthread
143
+ ORIG_SRCS = arena.c autolink.c blocks.c buffer.c cmark.c cmark_ctype.c commonmark.c core-extensions.c ext_scanners.c footnotes.c houdini_href_e.c houdini_html_e.c houdini_html_u.c html.c inlines.c iterator.c latex.c linked_list.c man.c map.c markly.c node.c plaintext.c plugin.c references.c registry.c render.c scanners.c strikethrough.c syntax_extension.c table.c tagfilter.c tasklist.c utf8.c xml.c
144
+ SRCS = $(ORIG_SRCS)
145
+ OBJS = arena.o autolink.o blocks.o buffer.o cmark.o cmark_ctype.o commonmark.o core-extensions.o ext_scanners.o footnotes.o houdini_href_e.o houdini_html_e.o houdini_html_u.o html.o inlines.o iterator.o latex.o linked_list.o man.o map.o markly.o node.o plaintext.o plugin.o references.o registry.o render.o scanners.o strikethrough.o syntax_extension.o table.o tagfilter.o tasklist.o utf8.o xml.o
146
+ HDRS = $(srcdir)/autolink.h $(srcdir)/buffer.h $(srcdir)/chunk.h $(srcdir)/cmark-gfm-core-extensions.h $(srcdir)/cmark-gfm-extension_api.h $(srcdir)/cmark-gfm-extensions_export.h $(srcdir)/cmark-gfm.h $(srcdir)/cmark-gfm_export.h $(srcdir)/cmark-gfm_version.h $(srcdir)/cmark_ctype.h $(srcdir)/config.h $(srcdir)/ext_scanners.h $(srcdir)/footnotes.h $(srcdir)/houdini.h $(srcdir)/html.h $(srcdir)/inlines.h $(srcdir)/iterator.h $(srcdir)/map.h $(srcdir)/markly.h $(srcdir)/node.h $(srcdir)/parser.h $(srcdir)/plugin.h $(srcdir)/references.h $(srcdir)/registry.h $(srcdir)/render.h $(srcdir)/scanners.h $(srcdir)/strikethrough.h $(srcdir)/syntax_extension.h $(srcdir)/table.h $(srcdir)/tagfilter.h $(srcdir)/tasklist.h $(srcdir)/utf8.h
147
+ LOCAL_HDRS =
148
+ TARGET = markly
149
+ TARGET_NAME = markly
150
+ TARGET_ENTRY = Init_$(TARGET_NAME)
151
+ DLLIB = $(TARGET).bundle
152
+ EXTSTATIC =
153
+ STATIC_LIB =
154
+
155
+ TIMESTAMP_DIR = .
156
+ BINDIR = $(bindir)
157
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
158
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
159
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
160
+ HDRDIR = $(sitehdrdir)$(target_prefix)
161
+ ARCHHDRDIR = $(sitearchhdrdir)$(target_prefix)
162
+ TARGET_SO_DIR =
163
+ TARGET_SO = $(TARGET_SO_DIR)$(DLLIB)
164
+ CLEANLIBS = $(TARGET_SO) $(TARGET_SO).dSYM
165
+ CLEANOBJS = $(OBJS) *.bak
166
+ TARGET_SO_DIR_TIMESTAMP = $(TIMESTAMP_DIR)/.sitearchdir.-.markly.time
167
+
168
+ all: $(DLLIB)
169
+ static: $(STATIC_LIB)
170
+ .PHONY: all install static install-so install-rb
171
+ .PHONY: clean clean-so clean-static clean-rb
172
+
173
+ clean-static::
174
+ clean-rb-default::
175
+ clean-rb::
176
+ clean-so::
177
+ clean: clean-so clean-static clean-rb-default clean-rb
178
+ -$(Q)$(RM_RF) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES) .*.time
179
+
180
+ distclean-rb-default::
181
+ distclean-rb::
182
+ distclean-so::
183
+ distclean-static::
184
+ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
185
+ -$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
186
+ -$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
187
+ -$(Q)$(RMDIRS) $(DISTCLEANDIRS) 2> /dev/null || true
188
+
189
+ realclean: distclean
190
+ install: install-so install-rb
191
+
192
+ install-so: $(DLLIB) $(TARGET_SO_DIR_TIMESTAMP)
193
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
194
+ clean-static::
195
+ -$(Q)$(RM) $(STATIC_LIB)
196
+ install-rb: pre-install-rb do-install-rb install-rb-default
197
+ install-rb-default: pre-install-rb-default do-install-rb-default
198
+ pre-install-rb: Makefile
199
+ pre-install-rb-default: Makefile
200
+ do-install-rb:
201
+ do-install-rb-default:
202
+ pre-install-rb-default:
203
+ @$(NULLCMD)
204
+ $(TARGET_SO_DIR_TIMESTAMP):
205
+ $(Q) $(MAKEDIRS) $(@D) $(RUBYARCHDIR)
206
+ $(Q) $(TOUCH) $@
207
+
208
+ site-install: site-install-so site-install-rb
209
+ site-install-so: install-so
210
+ site-install-rb: install-rb
211
+
212
+ .SUFFIXES: .c .m .cc .mm .cxx .cpp .o .S
213
+
214
+ .cc.o:
215
+ $(ECHO) compiling $(<)
216
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
217
+
218
+ .cc.S:
219
+ $(ECHO) translating $(<)
220
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
221
+
222
+ .mm.o:
223
+ $(ECHO) compiling $(<)
224
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
225
+
226
+ .mm.S:
227
+ $(ECHO) translating $(<)
228
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
229
+
230
+ .cxx.o:
231
+ $(ECHO) compiling $(<)
232
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
233
+
234
+ .cxx.S:
235
+ $(ECHO) translating $(<)
236
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
237
+
238
+ .cpp.o:
239
+ $(ECHO) compiling $(<)
240
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
241
+
242
+ .cpp.S:
243
+ $(ECHO) translating $(<)
244
+ $(Q) $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
245
+
246
+ .c.o:
247
+ $(ECHO) compiling $(<)
248
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
249
+
250
+ .c.S:
251
+ $(ECHO) translating $(<)
252
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
253
+
254
+ .m.o:
255
+ $(ECHO) compiling $(<)
256
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -c $(CSRCFLAG)$<
257
+
258
+ .m.S:
259
+ $(ECHO) translating $(<)
260
+ $(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)$@ -S $(CSRCFLAG)$<
261
+
262
+ $(TARGET_SO): $(OBJS) Makefile
263
+ $(ECHO) linking shared-object markly/$(DLLIB)
264
+ -$(Q)$(RM) $(@)
265
+ $(Q) $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
266
+ $(Q) $(POSTLINK)
267
+
268
+
269
+
270
+ $(OBJS): $(HDRS) $(ruby_headers)
data/ext/markly/arena.c CHANGED
@@ -68,15 +68,16 @@ static void *arena_calloc(size_t nmem, size_t size) {
68
68
  const size_t align = sizeof(size_t) - 1;
69
69
  sz = (sz + align) & ~align;
70
70
 
71
+ struct arena_chunk *chunk;
71
72
  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;
74
78
  }
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;
80
81
  *((size_t *) ptr) = sz - sizeof(size_t);
81
82
  return (uint8_t *) ptr + sizeof(size_t);
82
83
  }
@@ -98,6 +99,6 @@ static void arena_free(void *ptr) {
98
99
 
99
100
  cmark_mem CMARK_ARENA_MEM_ALLOCATOR = {arena_calloc, arena_realloc, arena_free};
100
101
 
101
- cmark_mem *cmark_get_arena_mem_allocator() {
102
+ cmark_mem *cmark_get_arena_mem_allocator(void) {
102
103
  return &CMARK_ARENA_MEM_ALLOCATOR;
103
104
  }
Binary file