Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cargo filename #1

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
14 changes: 7 additions & 7 deletions src/heap.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
| embed Heap
| 文件名称: heap.rs
| 文件作用: C程序的包装
Expand Down Expand Up @@ -34,16 +34,16 @@
//! wrapper for C implement

/// # Allocate memory
///
///
/// Allocate memory in heap.
///
///
/// ## Arguments
///
///
/// * `size`: need size, bytes
/// * `align`: memory alignment, bytes
///
///
/// ## Return Value
///
///
/// If succeeded, this function will return the start pointer for the block,
/// and if failed, it will return `None`.
pub fn allocate(size: usize, align: usize) -> Option<*mut u8> {
Expand All @@ -61,7 +61,7 @@ pub fn free(ptr: *mut u8) {
}

/// # Initialize heap
///
///
/// Initialize heap, it will initialize the free list in heap memory.
pub fn init() {
unsafe { emheap_impl_Heap_Init() };
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
OTHER DEALINGS IN THE SOFTWARE.
*/
//! # emheap
//!
//!
//! The `emheap` crate is a very simple memory manager for embedded systems and microprocessors.
//!
//!
//! Here are the main features:
//!
//!
//! 1. small: total no more than 350 lines of code.
//! 2. fragmentation collection:
//! the programming will merge the closest memory block to avoid fragmentation.
//! 3. cross-platform: it does not rely on any libraries.
//! 4. memory alignment: support memory alignment.
//!
//!
//! WARNING: **DO NOT** use this library on your PC.
//!
#![cfg_attr(not(test), no_std)]
Expand Down
3 changes: 1 addition & 2 deletions src/rsalloc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
| embed Heap
| 文件名称: rsalloc.rs
| 文件作用: Rust的分配器实现
Expand Down Expand Up @@ -53,4 +53,3 @@ unsafe impl GlobalAlloc for Allocator {
heap::free(ptr);
}
}