Closed magicant closed 1 month ago
The recent changes improve the handling of resource limits in the yash
project by replacing the rlim_t
type with a more descriptive Limit
type, enhancing type safety and code clarity. The constant RLIM_INFINITY
has also been standardized to INFINITY
, promoting consistency across the codebase. These updates streamline resource management and align with best practices in Rust, making the system more robust and maintainable.
Files | Change Summary |
---|---|
yash-builtin/src/ulimit.rs , yash-builtin/src/ulimit/resource.rs , |
Replaced rlim_t with Limit type in resource limit handling; updated scale method return type to Limit . |
yash-builtin/src/ulimit/set.rs , yash-builtin/src/ulimit/show.rs |
Replaced constant RLIM_INFINITY with INFINITY ; updated logic and tests accordingly to reflect new constant. |
yash-env/CHANGELOG.md , yash-env/src/system.rs , yash-env/src/system/real.rs |
Updated documentation and error handling; changed rlim_t to Limit and RLIM_INFINITY to INFINITY . |
yash-env/src/system/resource.rs , yash-env/src/system/virtual.rs |
Introduced RawLimit type alias for platform compatibility; updated use of constants and types in resource limit logic. |
yash-env/src/system/virtual/process.rs |
Updated handling of resource limits by replacing RLIM_INFINITY with INFINITY in various checks. |
sequenceDiagram
participant User
participant System
participant ResourceManager
User->>System: Request resource limit
System->>ResourceManager: Get current limits
ResourceManager-->>System: Returns Limit (soft, hard)
System-->>User: Provides limits (INFINITY, etc.)
🐰 In the land of code, a change took flight,
Types reshaped, bringing clarity bright.
Fromrlim_t
toLimit
, so clear and so bold,
WithINFINITY
shining, new tales to be told!
Hopping through limits, we celebrate the day,
For better resource handling is the bunny way! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This is part of #353.
Summary by CodeRabbit
New Features
Limit
type.RLIM_INFINITY
withINFINITY
.Bug Fixes
getrlimit
andsetrlimit
methods with specific error types.Documentation
INFINITY
constant.Chores