Code Monkey home page Code Monkey logo

utils's Introduction

hirofa_utils

This is a utility project which is used in several other projects

DOCS

CHANGELOG

js_utils

Abstractions & traits for JS engine related utilities

AutoIdMap

A map to which generates its own unique keys (usize)

Cache

A very simple cache

DebugMutex

A logging Mutex which makes life easier while debugging

EventLoop

A singlethreaded queue which acts as an EventLoop for several JavaScript engine projects

TaskManager

Simple thread pool using tokio

utils's People

Contributors

andrieshiemstra avatar sreeniio avatar actions-user avatar

Stargazers

Stéphane Derosiaux avatar  avatar Clownsw avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

sreeniio clownsw

utils's Issues

revamp timing resolution in steq

is now fixed at 250ms

todo, how to deal with interval timing, recalc based on wanted starttime, actual starttime, or endtime?

  • get rid o fthe need for that mutex

valgrind error with num_cpus

my error:

running 6 tests
test auto_id_map::tests::test_aim ... ok
test eventloop::tests::test ... ok
test eventloop::tests::test_sync ... ok
test js_utils::facades::values::tests::test_jsvf ... ok
==5283== Thread 2 task_manager::te:
==5283== Syscall param statx(file_name) points to unaddressable byte(s)
==5283==    at 0x4AFD9FE: statx (statx.c:29)
==5283==    by 0x2DA930: statx (weak.rs:136)
==5283==    by 0x2DA930: std::sys::unix::fs::try_statx (fs.rs:139)
==5283==    by 0x2CC035: file_attr (fs.rs:776)
==5283==    by 0x2CC035: metadata (fs.rs:493)
==5283==    by 0x2CC035: buffer_capacity_required (fs.rs:609)
==5283==    by 0x2CC035: <std::fs::File as std::io::Read>::read_to_string (fs.rs:645)
==5283==    by 0x27536E: num_cpus::linux::Cgroup::param (linux.rs:214)
==5283==    by 0x275219: num_cpus::linux::Cgroup::quota_us (linux.rs:203)
==5283==    by 0x2750A2: num_cpus::linux::Cgroup::cpu_quota (linux.rs:188)
==5283==    by 0x274CB1: num_cpus::linux::load_cgroups (linux.rs:149)
==5283==    by 0x27494D: num_cpus::linux::init_cgroups (linux.rs:129)
==5283==    by 0x27D3A8: core::ops::function::FnOnce::call_once (function.rs:227)
==5283==    by 0x27ED7A: std::sync::once::Once::call_once::{{closure}} (once.rs:262)
==5283==    by 0x136C27: std::sync::once::Once::call_inner (once.rs:419)
==5283==    by 0x27ED05: std::sync::once::Once::call_once (once.rs:262)
==5283==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5283== 
==5283== Syscall param statx(buf) points to unaddressable byte(s)
==5283==    at 0x4AFD9FE: statx (statx.c:29)
==5283==    by 0x2DA930: statx (weak.rs:136)
==5283==    by 0x2DA930: std::sys::unix::fs::try_statx (fs.rs:139)
==5283==    by 0x2CC035: file_attr (fs.rs:776)
==5283==    by 0x2CC035: metadata (fs.rs:493)
==5283==    by 0x2CC035: buffer_capacity_required (fs.rs:609)
==5283==    by 0x2CC035: <std::fs::File as std::io::Read>::read_to_string (fs.rs:645)
==5283==    by 0x27536E: num_cpus::linux::Cgroup::param (linux.rs:214)
==5283==    by 0x275219: num_cpus::linux::Cgroup::quota_us (linux.rs:203)
==5283==    by 0x2750A2: num_cpus::linux::Cgroup::cpu_quota (linux.rs:188)
==5283==    by 0x274CB1: num_cpus::linux::load_cgroups (linux.rs:149)
==5283==    by 0x27494D: num_cpus::linux::init_cgroups (linux.rs:129)
==5283==    by 0x27D3A8: core::ops::function::FnOnce::call_once (function.rs:227)
==5283==    by 0x27ED7A: std::sync::once::Once::call_once::{{closure}} (once.rs:262)
==5283==    by 0x136C27: std::sync::once::Once::call_inner (once.rs:419)
==5283==    by 0x27ED05: std::sync::once::Once::call_once (once.rs:262)
==5283==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5283== 
test cache::tests::test_cache ... ok
test task_manager::tests::test ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 9.45s

==5283== 
==5283== HEAP SUMMARY:
==5283==     in use at exit: 1,056 bytes in 2 blocks
==5283==   total heap usage: 577 allocs, 575 frees, 97,207 bytes allocated
==5283== 
==5283== LEAK SUMMARY:
==5283==    definitely lost: 0 bytes in 0 blocks
==5283==    indirectly lost: 0 bytes in 0 blocks
==5283==      possibly lost: 0 bytes in 0 blocks
==5283==    still reachable: 1,056 bytes in 2 blocks
==5283==         suppressed: 0 bytes in 0 blocks
==5283== Reachable blocks (those to which a pointer was found) are not shown.
==5283== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==5283== 
==5283== For lists of detected and suppressed errors, rerun with: -s
==5283== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Error: Process completed with exit code 123.

look sthe same as this issue, but i'm not going to build valgrind from source in my CI, todo check in 3 or 4 months if valgrinbd 3.19 is released and fixes this...

https://users.rust-lang.org/t/simple-fs-read-to-string-program-causes-valgrind-memcheck-errors/68722

panic due to runaway promises

In a complex use case where there are nested promise calls, the runtime is crashing with the following panics. Do you think these can be handled without panicking? I'm trying to create a simple, reproducible code sample, but unable to get it to panic.

thread panic occurred: panicked at 'no such elem', 
  .cargo/registry/src/github.com-1ecc6299db9ec823/
  hirofa_utils-0.5.7/src/auto_id_map.rs:132:29
thread panic occurred: panicked at 'send failed: SendError { .. }', 
  .cargo/registry/src/github.com-1ecc6299db9ec823/
  hirofa_utils-0.5.7/src/eventloop.rs:297:3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.