Commit Graph

7 Commits

Author SHA1 Message Date
Owain G. Ainsworth
0a3e7f682b Avoid the risk of leaking small amounts of memory.
Removing from the bottom of a stack (nipN(depth)) would leak the first
entry in the array by slicing [1:], leaving array[0] dangling an
inaccessible (but unable to be freed until the whole slice is gone). We
left it like this for a while, but best not to leak the memory. Happens
rarely so the performance hit shouldn't matter that much. Do the same
thing for condstack.
2013-09-26 01:53:11 +01:00
Owain G. Ainsworth
a63edcd2dc preallocate a few arrays.
When we do append loops, make an educated guess as to the size and make an array
with that capacity to avoid extra copying.

Doesn't affect the speed of the tests, over 4 runs the difference was lost in
the noise.
2013-09-25 17:38:20 +01:00
Owain G. Ainsworth
87e976a732 Add comment explaining OP_RESERVED behaviour with push ops. 2013-09-25 17:37:36 +01:00
Owain G. Ainsworth
22c29c4316 Perform pushed length checks at exec time, not parse.
To match bitcoind behaviour. Fix tests to agree with this direction.
2013-07-29 22:00:57 +01:00
Owain G. Ainsworth
bac455cdd2 Fix reversed test bug with the max operations handling
We were counting the number of push ops instead of the number of non
push ops.  Add tests that found this (checking tha the max operations
check fires).
2013-06-20 00:30:34 +01:00
Dave Collins
2a8cf9f44f Use correct import path for btcec. 2013-06-13 15:18:58 -05:00
Dave Collins
1197770159 Initial implementation. 2013-06-13 14:59:46 -05:00