13 Commits

Author SHA1 Message Date
tomFlowee c7192dff41 Add text-limit argument to writeHex
The BufferPool::writeHex() method takes a string-pointer, we add an int
max-number-of-chars to be parsed on that string.
This allows us to not just stop at the first non-hex char, but also
after a set number of characters.

This effectively allows us to use non-zere-terminated strings as
argument too.
2024-10-03 14:07:10 +02:00
tomFlowee 874c898430 Remove unused include 2024-01-13 18:06:58 +01:00
tomFlowee a2bad4e298 Make bufferpool more sturdy.
Calling commit with a negative value now no longer returns a
valid-but-broken buffer. It now returns an invalid buffer.
2023-09-04 14:10:35 +02:00
tomFlowee b1f6f497dd Prevent misuse of API 2021-08-05 22:43:24 +02:00
tomFlowee ae78dd0bb8 Update email address 2021-06-20 22:44:44 +02:00
TomZ 1434383f01 Simplify
Lets not be afraid of some pointer math...
2020-09-17 20:55:14 +02:00
TomZ 4e0b42d205 Fix BufferPool::forget()
Using the forget() method too many times could lead to an invalid
(negative size) ConstBuffer being created.
This fixes and immediately copies an assert used in many other places in
the code already.
2020-03-19 15:05:54 +01:00
TomZ 3cd54ed5e6 BufferPool; Add simple way to parse a hex string 2019-08-05 23:00:52 +02:00
TomZ 0bde548548 Improve allocation behavior in BufferPool
The old algorithm could end up doubling the size every time it
ran out, which eventually consumes all memory.
This way we reset to the user-default size when useful and increase
only based on need.

This means that the programmer needs to make a better estimation on
maximum size of messages, but it avoids behavior similar to memory
leaks.
2019-06-13 13:14:26 +02:00
TomZ d56b09fd5f Minor bugfixes
Better debug printing. Print hex array instead of 'text'
Fix possible deleted memory being accessed.
2019-03-31 19:51:26 +02:00
TomZ e7414fbb81 Fixes for signed ness and variable sizes. 2018-06-12 18:35:04 +02:00
TomZ f3a6f5e3b4 Add more raw streaming features to BufferPool 2018-05-09 10:48:16 +02:00
TomZ b76ca3a97e Start libs/utils 2018-02-13 13:27:58 +01:00