Commit graph

16 commits

Author SHA1 Message Date
Chris Wilson
55721d380d [script] Report line number
Count the number of newlines processed in the trace and provide an API for
the user to query.
2009-06-19 14:13:34 +01:00
Chris Wilson
6167f27adf [script] Fix memleak of duplicated strings from files
csi_string_new() duplicated the bytes which was not what was desired, so
implement a csi_string_new_for_bytes() to take ownership and prevent the
leak that was occuring, for example, every time we create a new font face.
2009-06-11 22:38:09 +01:00
Chris Wilson
d753ba96ab [script] Manage used entries within hash tables
Apply the patch from Karl Tomlinson,
https://bugs.freedesktop.org/attachment.cgi?id=19802, to repack the hash
table if the number of free slots falls too low.
2009-06-06 13:52:20 +01:00
Chris Wilson
867c88ae90 [script] Add a finish method to the interpreter
When using fonts circular references are established between the holdover
font caches and the interpreter which need manual intervention via
cairo_script_interpreter_finish() to break.
2009-06-06 12:59:39 +01:00
Chris Wilson
e38f85c5de [script] Pedantic violations
Fixup a few trivial errors with -pedantic.
2009-05-08 08:53:43 +01:00
Chris Wilson
fd96cea4fe [script] Improve array construction.
Limit the memory allocation to the initial array size and perform a direct
copy from the operand stack to the array.
2009-01-02 09:53:24 +00:00
Chris Wilson
463dc28913 [script] Allocate the interned strings from a permanent pool
Reduce memory fragmentation by allocating the permanent strings from a
single pool.
2008-12-12 12:00:44 +00:00
Chris Wilson
adc9c90d79 [script] Freed object cache.
Cache the last freed object to reduce malloc pressure.
2008-12-12 12:00:44 +00:00
Chris Wilson
c5c04528b5 [script] Slab allocator
Allocate small objects from a pool and maintain a per-size free-list.
2008-12-12 12:00:44 +00:00
Chris Wilson
83f0e6cf62 [script] Inline the stack push
Frequently to push an object onto the stack all we need is to simply
perform the struct copy - so inline it and only call the out-of-line
function if we need to enlarge the stack.
2008-12-12 12:00:43 +00:00
Chris Wilson
3abfd836a0 [script] Null constructor
Expose 'null', principally for comparison purposes.
2008-12-12 12:00:43 +00:00
Chris Wilson
177a68ef3e [script] Add a few mathematical constants
Just pi and the sqrt(2) for the moment, more to come on demand.
2008-12-12 12:00:42 +00:00
M Joonas Pihlaja
265ebd372a [script] Flesh out the relational comparison operators to be more PostScript-like.
The relational comparison operators can now compare strings vs names
by content as well as performing automatic type promotions on the
numeric types.  For other types relational comparisons succeeed
only if the values compare equal according to the eq operator, and
put the interpreter into a type-error state otherwise.
2008-12-12 12:00:42 +00:00
M Joonas Pihlaja
1aeb96dc28 [script] Implement PostScript-like semantics for the eq operator.
The eq operator would only work for some types and put the
interpreter in an error state if passed objects it didn't
know how to compare.  It would also not compare strings
by value nor allow strings to be compared to names.
This patch makes any two objects comparable.
2008-12-12 12:00:41 +00:00
Chris Wilson
c41b99268d Conditionally include byteswap.h
Fixup compilation by copying the checks from cairo-wideint-private.h to
conditionally include byteswap.h and provide fallback implementations.
2008-11-19 11:59:21 +00:00
Chris Wilson
cdfffc7420 Add CairoScript interpreter
Add a CairoScript interpreter library and use it to replay the test output
for the CairoScript backend. The library is also used by the currently
standalone Sphinx debugger [git://anongit.freedesktop.org/~ickle/sphinx].
The syntax/operator semantics are not yet finalized, but are expected to
mature before the next stable release.
2008-11-13 11:36:55 +00:00