summaryrefslogtreecommitdiff
path: root/include/parserutils/utils
Commit message (Collapse)AuthorAgeFilesLines
* (buffer): Add parserutils_buffer_appendv()Daniel Silverstone2022-11-261-0/+2
| | | | Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* Buffer: Optimise to minimise memmove shuffles.Michael Drake2021-05-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously the data in the linear buffer was always stored at the start of the allocation, pointed to by `buffer->data`. This was achieved by memmoving every time data was consumed from the front. Now the allocation is pointed to by `buffer->alloc`, and the start of the data is pointed to by `buffer->data` (as before). This means client code does not need to change to get at the data. The advantage comes when we discard the from the start of the buffer, when some data is consumed. We now simply advance the data pointer by the number of bytes to be discarded, and reduce the buffer length by the same amount. If the used portion of the buffer now fits between the start of the allocation and the current start of the data, it is memcpyed to the allocation start, otherwise it is left alone. This is a significant optimisation when the size of the chunk is large, such as when loading from disc. (When the first (only) "chunk" is just the whole file.
* Remove client allocation function.Michael Drake2013-12-143-8/+3
|
* Sprinkle some C++ scoping aroundJohn Mark Bell2010-10-233-0/+27
| | | | svn path=/trunk/libparserutils/; revision=10901
* Add ability to retrieve vector length. Fix missing note in iteration apiDaniel Silverstone2009-02-151-0/+1
| | | | svn path=/trunk/libparserutils/; revision=6527
* Remove dict, hash and rbtree from libparserutilsDaniel Silverstone2009-02-142-67/+0
| | | | svn path=/trunk/libparserutils/; revision=6512
* Chunked arrays: Pack length of entries into array as a prefix to the data.John Mark Bell2008-12-011-3/+3
| | | | | | Limit maximum length of data items stored in hash/chunked array to 2^16-1. svn path=/trunk/libparserutils/; revision=5858
* New datastructures:John Mark Bell2008-11-302-1/+33
| | | | | | | | | + Chunked array + Hash table (open addressing) Constify parameter to parserutils_stack_push svn path=/trunk/libparserutils/; revision=5850
* Return errors from dictionary constructor/destructorJohn Mark Bell2008-11-091-2/+3
| | | | svn path=/trunk/libparserutils/; revision=5673
* Return errors from constructors and destructors.John Mark Bell2008-11-083-9/+10
| | | | svn path=/trunk/libparserutils/; revision=5652
* Add API to vector to permit peeking.John Mark Bell2008-10-181-0/+2
| | | | svn path=/trunk/libparserutils/; revision=5596
* Move the location of the utf8 buffer every time we're asked for a character ↵John Mark Bell2008-08-131-0/+2
| | | | | | | | in debug mode. This leaks memory lots, deliberately. svn path=/trunk/libparserutils/; revision=5081
* ConstifyJohn Mark Bell2008-07-301-1/+2
| | | | svn path=/trunk/libparserutils/; revision=4827
* Make parserutils_dict_entry public.John Mark Bell2008-07-303-1/+68
| | | | | | Add basic implementations of a stack and a vector. svn path=/trunk/libparserutils/; revision=4824
* Have some generic dictionary implementation.John Mark Bell2008-05-101-0/+28
| | | | | | Even comes with testcases, which is nice. svn path=/trunk/libparserutils/; revision=4138
* Import parser construction utility libraryJohn Mark Bell2008-05-011-0/+39
svn path=/trunk/libparserutils/; revision=4111