Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

264 Commits

Repository files navigation

The Reloaded Memory Library



Psssh, nothing personnel kid

CoverageNuGetBuild Status

About

Reloaded.Memory is a high performance library which provides zero-cost abstractions for memory manipulation in C#.

It is designed to be as fast as possible, with no overhead, while providing useful functionality to the user.

  • Zero Cost Abstractions: Performance equivalent to using raw pointers.
  • Stable API: Versions 9.0.0 and above have a fully stable, backwards compatible API.
  • Trimming Safe: The library is fully compatible with .NET Core's Linker.
  • Fully Documented: The library is fully tested & documented with XML comments.
  • Cross Platform: 99% of the library is fully compatible with Windows, Linux and MacOS.
  • Large Address Aware: The library can correctly leverage all 4GB in x86 processes.

This project guarantees binary backwards compatibility; meaning you can substitute the library with any newer version without recompiling the source code. Should the need to introduce any breaking changes occur; much like the runtime.

Common Utilities

Common Classes within this Package Include:

Memory Manipulation:

ActionDescription
MemoryAllows you to Read, Write, Allocate & Change Memory Protection for Current Process.
ExternalMemoryRead, Write, Allocate & Change Memory Protection but for Another Process.

Streams Management:

ActionDescription
BigEndian(Reader/Writer)Read/write raw data in memory as Big Endian.
LittleEndian(Reader/Writer)Read/write raw data in memory as Little Endian.
BufferedStreamReaderHigh performance alternative to BinaryReader.

Extensions:

ActionDescription
(Array/Span)ExtensionsUnsafe slicing, references without bounds checks and SIMD accelerated extensions.
StreamExtensionsExtensions for reading and writing from/to generics.
StringExtensionsCustom Hash Function(s) and unsafe character references.

Utilities:

ActionDescription
ArrayRental & ArrayRentalSliceSafe wrapper around ArrayPool<T> rentals.
Box<T>Represents a boxed value type, providing build-time validation and automatic unboxing.
CircularBufferBasic high-performance circular buffer.
Pinnable<T>Utility for pinning C# objects for access from native code.

Base building blocks:

ActionDescription
Ptr<T> / MarshalledPtr<T>Abstraction over a pointer to arbitrary source.
FixedArrayPtr<T> & MarshalledFixedArrayPtr<T>Abstraction over a pointer with known length.

(This list is not exhaustive, please see the API Documentation for complete API)

Wiki & Documentation

For more information on how to use the library, please see the Wiki.
The wiki contains a lot of useful information on how to use the library, as well as many examples.

Community Feedback

If you have questions/bug reports/etc. feel free to Open an Issue.

Contributions are welcome and encouraged. Feel free to implement new features, make bug fixes or suggestions so long as they meet the quality standards set by the existing code in the repository.

For an idea as to how things are set up, see Reloaded Project Configurations.

Happy Hacking 💜

About

Managed, high performance, fully featured memory manipulation library written in C#, providing a very easy to use API.

Topics

Resources

Stars

96 stars

Watchers

6 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages