No description
Based on suggestion from bitbckt: I saw this in my feed, and feel it merits comment. I hope you don't mind the input. You'll want to monitor the load factor of the hash table and re- hash the table on insert when it is exceeded. Otherwise, key lookup will degrade toward linear time for sets of keys with a high number of collisions. The easiest way to implement the load factor is to maintain a count of allocated nodes in tvm_htab_t and divide that by the bucket count to obtain the load factor. Of course, you'd need the bucket count (HTAB_SIZE) to be dynamic, too. |
||
|---|---|---|
| bin | ||
| include/tvm | ||
| lib | ||
| libtvm | ||
| programs | ||
| src | ||
| tdb | ||
| .gitignore | ||
| GNUmakefile | ||
| README | ||
| SYNTAX | ||
TinyVM is a virtual machine where the goal is having a small footprint. Low memory usage, a small amount of code, and a small binary. This virtual machine has been branched into several other projects, including FastVM and SimpleVM, where performance and simplicity are the main goals respectively. TinyVM and all of its branches have differing goals, but they're each designed to execute the same code. FastVM may have better performance than TinyVM and SimpleVM, but it may also use more memory, more complex code, and take longer to compile. TinyVM may be smaller, and have a lighter footprint than the other branches, but it doesn't have the speed or simplicity of the other two. TVM code is made to be portable across these virtual machines, but there are tradeoffs to the VM you use to execute your code. Building can be accomplished on UNIX-like systems with make and GCC. There are no external dependencies, save the C standard library. Building can be accomplished using "make," or "make rebuild". To build a debug version, add "DEBUG=yes" after "make". To build a binary with profiling enabled, add "PROFILE=yes" after "make".