An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 5.3% on proxy.golang.org

proxy.golang.org : github.com/langhuihui/gomem

Package gomem provides efficient memory management and buffer operations for Go applications. It offers a Memory struct that can handle multiple byte buffers with optimized operations for reading, writing, copying, and manipulating data across multiple buffer segments. The Memory struct is designed for scenarios where you need to work with data that may be split across multiple byte slices, such as network protocols, file I/O, or streaming data. It provides methods for appending buffers, copying data, comparing memory contents, and creating readers for sequential data access. Key features: - Efficient handling of multiple byte buffers - Memory-safe operations with proper size tracking - Support for negative indexing in buffer operations - Integration with io.Writer and io.Reader interfaces - Optimized copying and comparison operations - Support for method chaining in append operations Example usage: Package gomem provides efficient memory management and buffer operations for Go applications. This file contains the MemoryReader implementation, which provides sequential reading capabilities for Memory structs with support for various data formats and reading patterns. MemoryReader implements the io.Reader interface and extends it with additional functionality for reading structured data, handling different byte orders, and managing reading state across multiple buffer segments. It's designed for scenarios where you need to parse or process data sequentially from a Memory struct. Key features: - Implements io.Reader interface for standard Go I/O compatibility - Support for reading individual bytes, byte arrays, and structured data - Big-endian and little-endian number reading capabilities - LEB128 (Little Endian Base 128) variable-length integer decoding - Efficient skipping and seeking operations - Support for unreading (moving backwards in the data stream) - Range operations for iterating over remaining data - Memory clipping operations for removing processed data Example usage: Package gomem provides efficient memory management and buffer operations for Go applications. This file contains the RecyclableMemory and memory allocator implementations, which provide advanced memory management capabilities with automatic recycling and scalable allocation. RecyclableMemory extends the basic Memory functionality with automatic memory recycling, allowing for efficient reuse of allocated memory blocks. The memory allocators provide different strategies for memory allocation, from simple fixed-size allocators to scalable multi-tier allocators that can grow dynamically based on demand. Key features: - RecyclableMemory with automatic memory recycling - ScalableMemoryAllocator for dynamic memory pool management - MemoryAllocator for fixed-size memory pools - Support for borrowing memory (temporary allocation) - Automatic cleanup and memory reuse - Integration with io.Reader for efficient data reading - Memory statistics and monitoring capabilities Example usage:

Registry - Source - Documentation - JSON - codemeta.json
purl: pkg:golang/github.com/langhuihui/gomem
License: MIT
Latest release: about 1 month ago
Namespace: github.com/langhuihui
Last synced: about 1 month ago