vteromero / vtenc Goto Github PK
View Code? Open in Web Editor NEWVTEnc C library
License: MIT License
VTEnc C library
License: MIT License
When a controlled error occurs in a API function and it needs to stop the execution, we must ensure that any allocated memory is freed before exiting.
Specifically, the *encode*
and *decode*
functions should always call encctx_close
and decctx_close
before returning.
At the moment, there are some leak memory when running the unit tests:
valgrind --leak-check=yes ./tests/unit/unit_tests
ERROR SUMMARY: 21 errors from 21 contexts (suppressed: 0 from 0)
Looks like a great library, I'm exciting to give it a spin!
When I looked at the benchmarks, I was impressed by the high encoding speed. Could you provide an insight why the decoding speed lags an order or magnitude behind the other implementations? Is this purely because the current state of the implementation or is there fundamental algorithmic limitation?
memcmp
compare stream of bytes, not arrays of other bigger types like uint16_t, uint32_t or uint64_t. You can still use it with those types, but you need to properly calculate the number of bytes to compare For example:
const size_t len = 4;
uint32_t a[len] = {0, 1, 2, 3};
uint32_t b[len] = {0, 10, 20, 30};
// WRONG: will output "Arrays are equal"
if (memcmp(a, b, len) == 0) {
printf("Arrays are equal\n");
} else {
printf("Arrays are different\n");
}
// CORRECT: will output "Arrays are different"
if (memcmp(a, b, len * sizeof(uint32_t)) == 0) {
printf("Arrays are equal\n");
} else {
printf("Arrays are different\n");
}
There are a couple of places where memcmp
is being used incorrectly:
tests/gov2.c
tests/timestamps.c
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.