Changeset 78f3828 in serd


Ignore:
Timestamp:
Sep 23, 2017, 6:59:23 AM (8 weeks ago)
Author:
David Robillard <d@…>
Branches:
master, serd1
Children:
2d9d00d
Parents:
f8c8f7e
git-author:
David Robillard <d@…> (09/23/17 05:54:09)
git-committer:
David Robillard <d@…> (09/23/17 06:59:23)
Message:

Use more efficient stack allocation and growth policies

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • NEWS

    rf8c8f7e r78f3828  
    33  * Support strict parsing of prefixed names
    44  * Report errors for all failing test cases
     5  * Use more efficient stack allocation and growth policies
    56  * Fix building with MSVC
    67
    7  -- David Robillard <d@drobilla.net>  Sat, 23 Sep 2017 14:41:49 +0200
     8 -- David Robillard <d@drobilla.net>  Sat, 23 Sep 2017 14:53:55 +0200
    89
    910serd (0.28.0) stable;
  • src/serd_internal.h

    rf8c8f7e r78f3828  
    157157    const size_t new_size = stack->size + n_bytes;
    158158    if (stack->buf_size < new_size) {
    159         stack->buf_size *= 2;
     159        stack->buf_size += (stack->buf_size >> 1); // *= 1.5
    160160        stack->buf = (uint8_t*)realloc(stack->buf, stack->buf_size);
    161161    }
  • src/writer.c

    rf8c8f7e r78f3828  
    863863    writer->root_uri     = SERD_URI_NULL;
    864864    writer->base_uri     = base_uri ? *base_uri : SERD_URI_NULL;
    865     writer->anon_stack   = serd_stack_new(sizeof(WriteContext));
     865    writer->anon_stack   = serd_stack_new(4 * sizeof(WriteContext));
    866866    writer->context      = context;
    867867    writer->list_subj    = SERD_NODE_NULL;
Note: See TracChangeset for help on using the changeset viewer.