Commits on Jun 7, 2012
  1. @davisp

    Fix code reloading for Jiffy

    As it turns out I did not understand the documenation for
    load/upgrade/unload correctly. load/upgrade are called conditionally if
    there's code in the VM for the NIF. Ie, no code means load is called,
    where as if code exists, upgrade is called.
    
    unload is called regardless once per load/unload. This means that
    load/upgrade in Jiffy's case will each create a state object and unload
    will free it each time. I was missing the fact that unload is called
    every time and hence I don't need to clear the state in upgrade.
    davisp committed Jun 7, 2012
  2. @davisp

    Be paranoid about the values sent to upgrade

    The docs aren't entirely clear on the order of calls for upgrades so
    this is mostly just in case old_priv ever happens to not be what load
    returned in priv.
    davisp committed Jun 6, 2012
  3. @davisp

    Fix hot code upgrades

    davisp committed Jun 6, 2012
Commits on Jun 5, 2012
  1. @davisp
  2. @davisp

    Update rebar to 2.0.0

    davisp committed Jun 5, 2012
Commits on Jun 1, 2012
  1. @davisp

    Add an option to ignore UTF-8 encoding errors

    By default Jiffy is quite strict in what it encodes. By default it will
    not allow invalid UTF-8 to be produced. This can cause issues when
    attempting to encode JSON that was decoded by other libraries as UTF-8
    semantics are not uniformly enforced.
    
    This patch adds an option 'force_utf8' to the encoder. If encoding hits
    an error for an invalid string it will forcefully mutate the object to
    contain only valid UTF-8 and return the resulting encoded JSON.
    
    For the most part this means it will strip any garbage data from
    binaries replacing it replacement codepoint U+FFFD. Although, it will
    also try and the common error of encoding surrogate pairs as three-byte
    sequences and reencode them into UTF-8 properly.
    davisp committed Jun 1, 2012
Commits on Apr 25, 2012
  1. @benoitc @davisp

    Update rebar and the Makefile

      * Update rebar to a more recent version
      * Update rebar.config for deprecation warnings
      * Allow people to export the REBAR environment variable to use
        their own version of rebar
      * Fixed `make clean`
    benoitc committed with davisp Apr 20, 2012
  2. @dch @davisp

    Windows: MSVC compatibility

    dch committed with davisp Apr 8, 2012
  3. @davisp

    Fix segfaul when encoding with the uescape option

    There was a bug that was resetting the extra amount of space needed when
    encoding unicode characters with the `uescape` option enabled.
    davisp committed Apr 25, 2012
Commits on Apr 23, 2012
  1. @davisp

    Cleanup Makefile

    davisp committed Apr 23, 2012
Commits on Mar 21, 2012
  1. @davisp

    Fix silly error in the README

    davisp committed Mar 21, 2012
Commits on Mar 15, 2012
  1. @davisp

    Fix uescapes for combining characters

    I had a silly direction mistake in a bit shift that was causing the high
    portion of all combining characters to be printed as \uD800 which is
    obviously wrong. This bug only affects people using the non-default
    uescape option during encoding.
    davisp committed Mar 15, 2012
Commits on Feb 25, 2012
  1. @davisp

    Updated rebar to latest master

    davisp committed Feb 25, 2012
Commits on Feb 13, 2012
  1. @davisp

    Ensure that encoded doubles have a decimal point

    Numbers like 1.0 were being encoded as <<"1">> which can lead to a bit
    of confusion. This merely checks if a decimial point exists and if not
    it appends ".0" to the value.
    davisp committed Feb 12, 2012
Commits on Jan 10, 2012
  1. @davisp
Commits on Jan 8, 2012
  1. @urbanserj @davisp

    Add pretty print

    jiffy:encode/2 now accepts a 'pretty' option that will format the JSON
    output using two-space indents.
    urbanserj committed with davisp Dec 11, 2011
  2. @davisp

    Reduce PropEr test size for speed

    I need to fix this so that object sizes don't explode when generating
    larger values. Basically, as the type generator recurses is should be
    adjusting the size value.
    davisp committed Jan 8, 2012
  3. @jeraymond @davisp
  4. @benoitc @davisp

    clean test/*.beam

    benoitc committed with davisp Jan 3, 2012
  5. @davisp

    Adjust number ranges to show bignum support

    Looks like there's a slight difference in the number of significant
    digits supported across platforms in strtod. This just adds a couple to
    force it into the bignum code.
    davisp committed Jan 8, 2012
  6. @davisp
  7. @davisp
Commits on Nov 14, 2011
  1. @davisp
  2. @davisp

    Remove atom generation

    Not only was I not actually sending atoms to Jiffy, the test will end up
    exhausting the atom table and crashing the Erlang VM.
    davisp committed Nov 13, 2011
  3. @davisp

    Implement PropEr tests for JSON parsing

    Big thanks to Dmitry Groshev [1] for help getting PropEr tests into
    Jiffy. These generate valid EJSON to check parsing as well as check
    that random inputs don't cause segfaults or other nasty effects.
    
    Future improvements would be to write a JSON generator as well as a
    version that introduces known errors into the binary for checking known
    parsing errors as well.
    
    [1] https://github.com/si14
    
    Fixes: #10
    davisp committed Nov 13, 2011
Commits on Nov 13, 2011
  1. @davisp

    Change test case file extension

    Rebar's eunit command wants to try and compile anything named *.erl in
    the tests/ directory which causes errors with the test expectation
    files. Rather than write a patch for rebar it was easier to just rename
    everything.
    davisp committed Nov 13, 2011
Commits on Oct 31, 2011
  1. @davisp

    Fix test plan for 004-strings.t

    davisp committed Oct 31, 2011
  2. @davisp

    Remove trailing whitespace

    davisp committed Oct 31, 2011
  3. @davisp

    Enforce Unicode constraints more strictly

    It was possible to pass some types of invalid UTF-8 through Jiffy's
    encoder. Specifically, if uescaping isn't used, values that would decode
    from 0xD800 to 0xDFFFF, 0xFFFE, 0xFFFF, and values greater than 0x10FFFF
    would not be flagged as invalid. Now they are.
    davisp committed Oct 31, 2011
Commits on Aug 28, 2011
  1. @davisp

    Fix uescape encoding bug

    The encoding length for unicode values was applied to the wrong index
    variable.
    
    Thanks to Paul Guyot for the detailed bug report and fix.
    
    Fixes #7
    davisp committed Aug 28, 2011
Commits on Aug 3, 2011
  1. @davisp

    Fixed large number encoding on 32bit architectures

    I was accidentally truncating numbers when casting to long on
    machines that don't have longs that are 8 bytes.
    
    Fixes #5
    davisp committed Aug 3, 2011
  2. @davisp

    Remove reloading entry from jiffy.app.

    Multiple error reports on this.
    
    Fixes #6
    davisp committed Aug 3, 2011
Commits on Jun 29, 2011
  1. @davisp
Commits on Jun 13, 2011
  1. @davisp

    Improved NIF initialization.

    davisp committed Jun 13, 2011
  2. @davisp

    Document the API updates.

    davisp committed Jun 13, 2011