tiffany352 / rink-rs

Unit conversion tool and library written in rust
https://rinkcalc.app/about
GNU General Public License v3.0
408 stars 28 forks source link

Sandboxing #100

Closed tiffany352 closed 3 years ago

tiffany352 commented 3 years ago

This adds sandboxing functionality to rink CLI, limiting both execution time and memory usage.

For limiting memory usage, I used the now-stable GlobalAllocator API. For limiting CPU time, I used a simple timeout in the managing process. Doing it this way avoids any dependencies on OS-specific APIs. The memory tracking is also much more accurate & reliable than using OS metrics.