couchdb-jiffy.git
8 months agoswitch to rebar3 rebar3
Robert Newson [Mon, 4 Oct 2021 21:17:44 +0000 (22:17 +0100)] 
switch to rebar3

16 months agoMerge remote-tracking branch 'davisp/master' CouchDB-1.0.5-1
Robert Newson [Tue, 16 Feb 2021 17:30:06 +0000 (17:30 +0000)] 
Merge remote-tracking branch 'davisp/master'

18 months agoFix support for R16
Paul J. Davis [Mon, 14 Dec 2020 21:29:37 +0000 (15:29 -0600)] 
Fix support for R16

18 months agoJiffy 1.0.8 1.0.8
Paul J. Davis [Thu, 10 Dec 2020 16:07:15 +0000 (10:07 -0600)] 
Jiffy 1.0.8

18 months agoRemove unnecessary `maybe_map/1`
Paul J. Davis [Thu, 10 Dec 2020 16:06:31 +0000 (10:06 -0600)] 
Remove unnecessary `maybe_map/1`

Thought slightly harder and realized this was unnecessary.

18 months agoJiffy 1.0.7 1.0.7
Paul J. Davis [Thu, 10 Dec 2020 16:04:05 +0000 (10:04 -0600)] 
Jiffy 1.0.7

18 months agoFixes #206
Paul J. Davis [Thu, 10 Dec 2020 16:03:35 +0000 (10:03 -0600)] 
Fixes #206

20 months agoFinally write down the package uplaod command
Paul J. Davis [Thu, 22 Oct 2020 14:56:44 +0000 (09:56 -0500)] 
Finally write down the package uplaod command

20 months agoJiffy 1.0.6 1.0.6
Paul J. Davis [Thu, 22 Oct 2020 14:54:33 +0000 (09:54 -0500)] 
Jiffy 1.0.6

20 months agoFix bug in bytes_per_red option
Paul J. Davis [Thu, 22 Oct 2020 14:53:26 +0000 (09:53 -0500)] 
Fix bug in bytes_per_red option

Turns out this was never implemented correctly since it was referring to
the original bytes_per_iter atom.

23 months agoJiffy 1.0.5 1.0.5
Paul J. Davis [Tue, 30 Jun 2020 17:26:27 +0000 (12:26 -0500)] 
Jiffy 1.0.5

23 months agoSilence compiler warnings for tests
Paul J. Davis [Tue, 30 Jun 2020 17:20:18 +0000 (12:20 -0500)] 
Silence compiler warnings for tests

23 months agoUpdate rebar/enc binaries to R15B03-1
Paul J. Davis [Tue, 30 Jun 2020 17:20:34 +0000 (12:20 -0500)] 
Update rebar/enc binaries to R15B03-1

The recent release of Erlang 23.0 removed support for loading beam
modules compiled under R14 and earlier. Thus we're now forced to abandon
support for R13 and R14.

2 years agoMerge remote-tracking branch 'davisp/master' master CouchDB-1.0.4-1
Paul J. Davis [Thu, 27 Feb 2020 18:01:54 +0000 (12:01 -0600)] 
Merge remote-tracking branch 'davisp/master'

2 years ago1.0.4 1.0.4
Paul J. Davis [Thu, 27 Feb 2020 17:48:51 +0000 (11:48 -0600)] 
1.0.4

2 years agoFix binary leak when encoding large strings
Paul J. Davis [Thu, 27 Feb 2020 17:45:58 +0000 (11:45 -0600)] 
Fix binary leak when encoding large strings

This bug was due to an interaction between two optimizations. If we
attempt to flush the buffer before any bytes are used we refused.
However, in enc_ensure we were not checking whether the buffer was
actually flushed so we would allocate a new buffer for the request.

The easiest way to encounter this issue was by encoding a raw binary
longer than 2041 bytes (i.e., `jiffy:encode(<<"stuff...">>).`).

2 years agoMerge remote-tracking branch 'davisp/master' CouchDB-1.0.3-1
Paul J. Davis [Thu, 6 Feb 2020 21:59:01 +0000 (15:59 -0600)] 
Merge remote-tracking branch 'davisp/master'

2 years agoVersion 1.0.3 1.0.3
Paul J. Davis [Thu, 6 Feb 2020 21:52:59 +0000 (15:52 -0600)] 
Version 1.0.3

2 years agoForce Windows to export inlined functions
Joan Touzet [Thu, 6 Feb 2020 20:55:10 +0000 (15:55 -0500)] 
Force Windows to export inlined functions

2 years agoMerge remote-tracking branch 'davisp/master' CouchDB-1.0.2-1
Paul J. Davis [Wed, 5 Feb 2020 15:59:42 +0000 (09:59 -0600)] 
Merge remote-tracking branch 'davisp/master'

2 years agoOnly use -flto when supported 1.0.2
Paul J. Davis [Tue, 4 Feb 2020 20:53:30 +0000 (14:53 -0600)] 
Only use -flto when supported

This adds a dynamic check to see if -flto is supported by the compiler.

Co-Authored-By: JianBo He <heeejianbo@gmail.com>
2 years agoUpdate Travis-CI Matrix
Paul J. Davis [Tue, 4 Feb 2020 20:42:21 +0000 (14:42 -0600)] 
Update Travis-CI Matrix

Apparently Travis-CI has dropped some of the older Erlang versions. I've
also added a run on 22.x

2 years agoMerge remote-tracking branch 'davisp/master' CouchDB-1.0.1-1
Paul J. Davis [Sun, 5 Jan 2020 20:15:39 +0000 (14:15 -0600)] 
Merge remote-tracking branch 'davisp/master'

3 years ago1.0.1 1.0.1
Paul J. Davis [Mon, 13 May 2019 17:06:45 +0000 (12:06 -0500)] 
1.0.1

3 years agoUse from_array instead of positional versions
Paul J. Davis [Mon, 13 May 2019 16:57:57 +0000 (11:57 -0500)] 
Use from_array instead of positional versions

3 years agoFix backwards compatibility
Paul J. Davis [Mon, 13 May 2019 16:53:39 +0000 (11:53 -0500)] 
Fix backwards compatibility

3 years agoRemove accidentally commited rebar state
Paul J. Davis [Mon, 13 May 2019 16:53:22 +0000 (11:53 -0500)] 
Remove accidentally commited rebar state

3 years agoFix R14 support
Paul J. Davis [Mon, 13 May 2019 14:45:34 +0000 (09:45 -0500)] 
Fix R14 support

3 years agoFix support of VMs pre-17.x
Paul J. Davis [Mon, 13 May 2019 14:39:31 +0000 (09:39 -0500)] 
Fix support of VMs pre-17.x

3 years agoFix support for Erlang 17.x
Paul J. Davis [Mon, 13 May 2019 14:37:18 +0000 (09:37 -0500)] 
Fix support for Erlang 17.x

3 years ago1.0.0 1.0.0
Paul J. Davis [Mon, 13 May 2019 14:13:54 +0000 (09:13 -0500)] 
1.0.0

3 years agoUpdate readme with the exception type change
Paul J. Davis [Mon, 13 May 2019 14:13:13 +0000 (09:13 -0500)] 
Update readme with the exception type change

3 years agoUpgrade to double-converson 3.1.4
Paul J. Davis [Mon, 13 May 2019 14:11:06 +0000 (09:11 -0500)] 
Upgrade to double-converson 3.1.4

3 years agoChange errors for bignums to be more explicit
Paul J. Davis [Mon, 13 May 2019 13:58:58 +0000 (08:58 -0500)] 
Change errors for bignums to be more explicit

Co-Authored-By: Stephan Renatus <srenatus@chef.io>
3 years agoRemove -fno-strict-aliasing
John Högberg [Thu, 11 Apr 2019 12:53:24 +0000 (14:53 +0200)] 
Remove -fno-strict-aliasing

We don't do fishy things like type punning so it really isn't
necessary, and supplying it prevents certain optimizations.

3 years agoGet rid of separate unsigned/signed buffers
John Högberg [Thu, 11 Apr 2019 11:32:45 +0000 (13:32 +0200)] 
Get rid of separate unsigned/signed buffers

3 years agoNever expand the encode buffer; emit and restart
John Högberg [Thu, 11 Apr 2019 11:30:05 +0000 (13:30 +0200)] 
Never expand the encode buffer; emit and restart

This greatly increases the performance of long string encodes as
we won't need to copy intermediate results over and over.

3 years agoFix erroneous state check in the decoder
John Högberg [Thu, 11 Apr 2019 04:39:33 +0000 (06:39 +0200)] 
Fix erroneous state check in the decoder

If the input contained a mismatched end-of-array/object, the stack
could become empty before a call to dec_curr, which would look
beyond the bounds of the stack. If the value at this invalid
position happened to be st_array, we would pop too much from the
stack and overwrite the data that came before it.

This commit fixes this by letting dec_pop return the previous
state or st_invalid if the stack is empty, letting us exit
gracefully if the state isn't what we expect it to be.

dec_pop_assert is identical to the old dec_pop, tearing down the
emulator on internal errors.

3 years agoEnable link-time optimization on *nix platforms
John Högberg [Mon, 8 Apr 2019 05:45:51 +0000 (07:45 +0200)] 
Enable link-time optimization on *nix platforms

3 years agoMove all atom checks under enif_is_atom
John Högberg [Tue, 9 Apr 2019 10:17:13 +0000 (12:17 +0200)] 
Move all atom checks under enif_is_atom

3 years agoUse the result map for key dedupe
John Högberg [Tue, 9 Apr 2019 08:17:05 +0000 (10:17 +0200)] 
Use the result map for key dedupe

This is a wee bit more cache-friendly than using a std::set with
string keys.

3 years agoRefactor trapping and trap more often during decode
John Högberg [Tue, 9 Apr 2019 07:17:17 +0000 (09:17 +0200)] 
Refactor trapping and trap more often during decode

3 years agoSkip erroneous UTF-8 validation for atoms
John Högberg [Tue, 9 Apr 2019 06:08:23 +0000 (08:08 +0200)] 
Skip erroneous UTF-8 validation for atoms

We requested atoms in latin1 and then handled them as utf-8,
erroring out on some valid atoms and performing pointless
validation on others.

3 years agoUse enif_is_identical for equality checks
John Högberg [Tue, 9 Apr 2019 05:56:21 +0000 (07:56 +0200)] 
Use enif_is_identical for equality checks

3 years agoReplace sprintf with a dedicated integer print routine
John Högberg [Tue, 9 Apr 2019 05:40:22 +0000 (07:40 +0200)] 
Replace sprintf with a dedicated integer print routine

3 years agoSkip redundant enif_is_empty_list checks during encode
John Högberg [Tue, 9 Apr 2019 05:18:34 +0000 (07:18 +0200)] 
Skip redundant enif_is_empty_list checks during encode

enif_get_list_cell fails when the list is empty.

3 years agoUse realloc instead of doing it manually
John Högberg [Tue, 9 Apr 2019 05:12:21 +0000 (07:12 +0200)] 
Use realloc instead of doing it manually

3 years agoWalk through strings once when encoding
John Högberg [Mon, 8 Apr 2019 14:04:33 +0000 (16:04 +0200)] 
Walk through strings once when encoding

3 years agoUse an array for the position stack rather than an Erlang list
John Högberg [Mon, 8 Apr 2019 10:57:16 +0000 (12:57 +0200)] 
Use an array for the position stack rather than an Erlang list

3 years agosizeof(char) == 1 by definition
John Högberg [Tue, 9 Apr 2019 10:35:03 +0000 (12:35 +0200)] 
sizeof(char) == 1 by definition

3 years ago0.15.2
Paul J. Davis [Fri, 11 May 2018 17:14:31 +0000 (12:14 -0500)] 
0.15.2

3 years agoRaise errors instead of throwing
Eric Meadows-Jönsson [Sat, 4 Jun 2016 19:59:03 +0000 (21:59 +0200)] 
Raise errors instead of throwing

3 years agoDocumentation improvement decode option copy_strings.
Andreas Krüger [Wed, 14 Mar 2018 11:29:00 +0000 (12:29 +0100)] 
Documentation improvement decode option copy_strings.

3 years agofix bug on hex escape table
Jihyun Yu [Wed, 26 Sep 2018 10:18:19 +0000 (19:18 +0900)] 
fix bug on hex escape table

number of items on `hexvals` is 128 while table size is 256, so
remaining 128 items are filled with zero. As a result, values in
\xf0-\xff will be treated as zero while should be rejected.

3 years agoFix decoding of "\uDBFF\uDFFF" surrogate pair.
David Hull [Wed, 13 Feb 2019 00:21:30 +0000 (00:21 +0000)] 
Fix decoding of "\uDBFF\uDFFF" surrogate pair.

4 years agoadd test erlang/otp 21
getong [Mon, 25 Jun 2018 12:27:40 +0000 (20:27 +0800)] 
add test erlang/otp 21

4 years agoExplicitly list xmerl for relase to include it
Martin Wiso [Fri, 11 May 2018 10:15:28 +0000 (12:15 +0200)] 
Explicitly list xmerl for relase to include it

4 years ago0.15.1 0.15.1
Paul J. Davis [Thu, 8 Mar 2018 17:09:08 +0000 (11:09 -0600)] 
0.15.1

4 years agoAdd missing option for copy strings
Sam Tavakoli [Thu, 8 Mar 2018 15:33:24 +0000 (15:33 +0000)] 
Add missing option for copy strings

Without this, call to decode with copy_strings option in an
application will make Dialyzer complain when using the exported type for options

4 years agoThis is 0.15.0 0.15.0
Paul J. Davis [Fri, 5 Jan 2018 19:12:20 +0000 (13:12 -0600)] 
This is 0.15.0

4 years agofixed issue 162 regarding duplicate keys in objects
Lynn Gabbay [Fri, 5 Jan 2018 17:51:24 +0000 (01:51 +0800)] 
fixed issue 162 regarding duplicate keys in objects

4 years agoAdd `copy_strings` feature
Paul J. Davis [Wed, 1 Nov 2017 19:18:15 +0000 (14:18 -0500)] 
Add `copy_strings` feature

Some users of Jiffy have experienced issues when decoding large JSON
documents. Normally Jiffy expects smallish documents and returns any
strings as sub-binaries. When dealing with large documents these
sub-binary references can keep a large amount of RAM around unless the
user goes through and applies `binary:copy/1` on every string returned
from Jiffy. This however causes a large amount of CPU usage to do
something that Jiffy could do as it builds the JSON structure.

The `copy_strings` decoder option does exactly this. Instead of
returning sub-binaries Jiffy now copies every string into a newly
allocated binary. Users report that this fixes the memory issues while
also not negatively affecting performance significantly.

4 years agoMerge remote-tracking branch 'davisp/master' CouchDB-0.14.13-1
Paul J. Davis [Wed, 1 Nov 2017 19:31:06 +0000 (14:31 -0500)] 
Merge remote-tracking branch 'davisp/master'

4 years agoBump to 0.14.13 0.14.13
Paul J. Davis [Wed, 1 Nov 2017 19:30:09 +0000 (14:30 -0500)] 
Bump to 0.14.13

4 years agoFix type spec
Paul J. Davis [Wed, 1 Nov 2017 19:29:37 +0000 (14:29 -0500)] 
Fix type spec

4 years agoBump to 0.14.12 0.14.12
Paul J. Davis [Tue, 31 Oct 2017 17:11:18 +0000 (12:11 -0500)] 
Bump to 0.14.12

4 years agoAdd tests for deduplication in child objects
Paul J. Davis [Tue, 31 Oct 2017 17:10:49 +0000 (12:10 -0500)] 
Add tests for deduplication in child objects

4 years agoDocument dedupe_keys option
Paul J. Davis [Tue, 31 Oct 2017 17:09:56 +0000 (12:09 -0500)] 
Document dedupe_keys option

4 years agoMerge remote-tracking branch 'davisp/master' CouchDB-0.14.11-2
Paul J. Davis [Mon, 30 Oct 2017 21:40:55 +0000 (16:40 -0500)] 
Merge remote-tracking branch 'davisp/master'

4 years agoAdd `dedupe_keys` option
Paul J. Davis [Mon, 30 Oct 2017 19:01:53 +0000 (14:01 -0500)] 
Add `dedupe_keys` option

You can no optionally request that keys are deduplicate inside of Jiffy
instead of having to perform that operation in Erlang.

4 years agoTighten string buffer size calculation in enc_string.
David Hull [Thu, 5 Oct 2017 20:48:56 +0000 (20:48 +0000)] 
Tighten string buffer size calculation in enc_string.

When "\u"-escaping a Unicode character, the esc_extra value doesn't
need to include the number of bytes in the input string.  That is, if
a three-byte UTF-8 character is being escaped to a six-byte "\uXXXX"
sequence, esc_extra only needs to be increased by 3.

4 years agotest erlang 20
getong [Tue, 29 Aug 2017 10:01:58 +0000 (18:01 +0800)] 
test erlang 20

4 years agoMerge remote-tracking branch 'davisp/master' CouchDB-0.14.11-1
Paul J. Davis [Thu, 6 Jul 2017 22:35:24 +0000 (17:35 -0500)] 
Merge remote-tracking branch 'davisp/master'

4 years agoMerge pull request #151 from wohali/win32-cleanup
Paul J. Davis [Thu, 6 Jul 2017 22:33:44 +0000 (17:33 -0500)] 
Merge pull request #151 from wohali/win32-cleanup

Cleanup after new enc lands

4 years agoMerge remote-tracking branch 'davisp/master'
Paul J. Davis [Thu, 6 Jul 2017 22:31:13 +0000 (17:31 -0500)] 
Merge remote-tracking branch 'davisp/master'

4 years agoUpdate enc for Windows support
Paul J. Davis [Thu, 6 Jul 2017 22:26:17 +0000 (17:26 -0500)] 
Update enc for Windows support

4 years agoCleanup after new enc lands
Joan Touzet [Thu, 6 Jul 2017 21:05:55 +0000 (17:05 -0400)] 
Cleanup after new enc lands

5 years agoMerge remote-tracking branch 'davisp/master'
Paul J. Davis [Wed, 7 Jun 2017 16:00:57 +0000 (11:00 -0500)] 
Merge remote-tracking branch 'davisp/master'

Update to latest Jiffy

5 years agoReplace old test case with generated data
Paul J. Davis [Wed, 7 Jun 2017 15:54:35 +0000 (10:54 -0500)] 
Replace old test case with generated data

For some reason I left a 377KiB test case checked in. Replacing this
with a generated test case is obvious in hindsight.

5 years agoSpecify the escript executable for hooks
Paul J. Davis [Fri, 17 Mar 2017 20:34:32 +0000 (15:34 -0500)] 
Specify the escript executable for hooks

Windows appears to not enjoy relative path names for exectuables so
hopefully this fixes things there.

Fixes #83

5 years agoJiffy 0.14.11 0.14.11
Paul J. Davis [Sat, 31 Dec 2016 02:59:49 +0000 (20:59 -0600)] 
Jiffy 0.14.11

5 years agoMaintain my own file list for hex
Paul J. Davis [Sat, 31 Dec 2016 02:57:25 +0000 (20:57 -0600)] 
Maintain my own file list for hex

Apparently hex only includes some files by default but not others
rather than a sane default of anything except for VCS directories. So
now I also get to maintain a list of files in my .app.src.

5 years agoBump to 0.14.10 because rebar3 is inept 0.14.10
Paul J. Davis [Thu, 29 Dec 2016 18:46:54 +0000 (12:46 -0600)] 
Bump to 0.14.10 because rebar3 is inept

Apparently rebar3 can't generate a sane version number from Git tags and
adds a bunch of BS build number and ref tags which hex.pm then rejects.
Given that I can't find any documentation on how that works and reading
code is an exercise in over engineered abstractionism I've succumbed to
the demoralizing conclusion that I'll just have to go back to the dark
ages and maintain my versions both in source and in version control.

5 years agoAdd `use_nil` to `encode_option` 0.14.9
Dan Swain [Thu, 19 May 2016 22:44:53 +0000 (18:44 -0400)] 
Add `use_nil` to `encode_option`

A call to `jiffy:encode(Term, [use_nil]).` will currently cause dialyzer
to issue a warning because `use_nil` is not included in `encode_option`.
This appears to just be an omission.

5 years agoMerge pull request #118 from davisp/feature-add-rebar3-support
Paul J. Davis [Mon, 10 Oct 2016 16:53:57 +0000 (11:53 -0500)] 
Merge pull request #118 from davisp/feature-add-rebar3-support

Add support for rebar3

5 years agoAdd support for rebar3
Paul J. Davis [Fri, 18 Mar 2016 20:48:20 +0000 (15:48 -0500)] 
Add support for rebar3

Allow Jiffy to be used easily in projects using either rebar 2 or 3.

5 years agoUpdate the list of Erlang VMs to use on Travis-CI
Paul J. Davis [Fri, 23 Sep 2016 20:35:20 +0000 (15:35 -0500)] 
Update the list of Erlang VMs to use on Travis-CI

5 years agoReplace PropEr with EQC
Paul J. Davis [Fri, 23 Sep 2016 20:19:19 +0000 (15:19 -0500)] 
Replace PropEr with EQC

PropEr broke my support for R14. Turns out that EQC Mini is quite usable
so I've just switched to that. If EQC Mini exists it will be used, if
not the test is skipped gracefully.

5 years agoMerge branch 'upstream'
Paul J. Davis [Thu, 14 Jul 2016 20:41:24 +0000 (15:41 -0500)] 
Merge branch 'upstream'

5 years agoFix enc_long for 64-bit Windows
Paul J. Davis [Wed, 13 Jul 2016 19:46:22 +0000 (14:46 -0500)] 
Fix enc_long for 64-bit Windows

Originally reported by @NorthNick on apache/couchdb-jiffy.

6 years agoMerge pull request #119 from egobrain/patch-1
Paul J. Davis [Wed, 6 Apr 2016 15:08:49 +0000 (10:08 -0500)] 
Merge pull request #119 from egobrain/patch-1

Fixed wrong jiffy:decode/2 spec

6 years agoFixed wrong jiffy:decode/2 spec
Yakov [Wed, 6 Apr 2016 10:22:01 +0000 (14:22 +0400)] 
Fixed wrong jiffy:decode/2 spec

6 years agoFix force_utf8 for object keys 0.14.8
Paul J. Davis [Thu, 31 Mar 2016 16:00:10 +0000 (11:00 -0500)] 
Fix force_utf8 for object keys

Previously if a key was malformed UTF-8 and the user specified the
`force_utf8` option we would fail to try and encode a fixed up version
of the object. This was due to missing a clause to catch the
`invalid_object_member_key` exception. This adds the clause and a couple
tests to ensure it works.

6 years agoCopy double-conversion license to root LICENSE 0.14.7
Paul J. Davis [Wed, 6 Jan 2016 19:28:05 +0000 (13:28 -0600)] 
Copy double-conversion license to root LICENSE

This was marked in the c_src/double-conversion directory but I've gone
ahead and added a copy to the root LICENSE file.

6 years agoIgnore hexer.config 0.14.6
Paul J. Davis [Wed, 6 Jan 2016 19:07:47 +0000 (13:07 -0600)] 
Ignore hexer.config

6 years agoUpdate jiff.app.src for hex.pm
Paul J. Davis [Wed, 6 Jan 2016 19:03:05 +0000 (13:03 -0600)] 
Update jiff.app.src for hex.pm

Time for Jiffy to enter the world of Erlang package management.

6 years agoRemove ETAP license information
Paul J. Davis [Wed, 6 Jan 2016 18:59:08 +0000 (12:59 -0600)] 
Remove ETAP license information

6 years agoDocument the use_nil option for encoding JSON
Paul J. Davis [Wed, 2 Dec 2015 17:29:36 +0000 (11:29 -0600)] 
Document the use_nil option for encoding JSON

6 years agoRemove old debug printing 0.14.5
Paul J. Davis [Wed, 2 Dec 2015 17:23:30 +0000 (11:23 -0600)] 
Remove old debug printing

6 years agoMerge pull request #113 from jparise/map-iter-destroy
Paul J. Davis [Wed, 2 Dec 2015 17:21:32 +0000 (11:21 -0600)] 
Merge pull request #113 from jparise/map-iter-destroy

Destroy map iterators once we're done with them.