| ... | ... | @@ -20,23 +20,20 @@ ptr: *anyopaque, |
| 20 | 20 | vtable: *const VTable, |
| 21 | 21 | |
| 22 | 22 | pub const VTable = struct { |
| 23 | | /// Allocate exactly `len` bytes aligned to `alignment`, or return `null` |
| 24 | | /// indicating the allocation failed. |
| 23 | /// Return a pointer to `len` bytes with specified `alignment`, or return |
| 24 | /// `null` indicating the allocation failed. |
| 25 | 25 | /// |
| 26 | 26 | /// `ret_addr` is optionally provided as the first return address of the |
| 27 | 27 | /// allocation call stack. If the value is `0` it means no return address |
| 28 | 28 | /// has been provided. |
| 29 | | /// |
| 30 | | /// The returned slice of memory must have been `@memset` to `undefined` |
| 31 | | /// by the allocator implementation. |
| 32 | 29 | alloc: *const fn (*anyopaque, len: usize, alignment: Alignment, ret_addr: usize) ?[*]u8, |
| 33 | 30 | |
| 34 | 31 | /// Attempt to expand or shrink memory in place. |
| 35 | 32 | /// |
| 36 | 33 | /// `memory.len` must equal the length requested from the most recent |
| 37 | | /// successful call to `alloc` or `resize`. `alignment` must equal the same |
| 38 | | /// value that was passed as the `alignment` parameter to the original |
| 39 | | /// `alloc` call. |
| 34 | /// successful call to `alloc`, `resize`, or `remap`. `alignment` must |
| 35 | /// equal the same value that was passed as the `alignment` parameter to |
| 36 | /// the original `alloc` call. |
| 40 | 37 | /// |
| 41 | 38 | /// A result of `true` indicates the resize was successful and the |
| 42 | 39 | /// allocation now has the same address but a size of `new_len`. `false` |
| ... | ... | @@ -53,9 +50,9 @@ pub const VTable = struct { |
| 53 | 50 | /// Attempt to expand or shrink memory, allowing relocation. |
| 54 | 51 | /// |
| 55 | 52 | /// `memory.len` must equal the length requested from the most recent |
| 56 | | /// successful call to `alloc` or `resize`. `alignment` must equal the same |
| 57 | | /// value that was passed as the `alignment` parameter to the original |
| 58 | | /// `alloc` call. |
| 53 | /// successful call to `alloc`, `resize`, or `remap`. `alignment` must |
| 54 | /// equal the same value that was passed as the `alignment` parameter to |
| 55 | /// the original `alloc` call. |
| 59 | 56 | /// |
| 60 | 57 | /// A non-`null` return value indicates the resize was successful. The |
| 61 | 58 | /// allocation may have same address, or may have been relocated. In either |
| ... | ... | @@ -73,11 +70,10 @@ pub const VTable = struct { |
| 73 | 70 | |
| 74 | 71 | /// Free and invalidate a region of memory. |
| 75 | 72 | /// |
| 76 | | /// `memory.len` must equal the most recent length returned by `alloc` or |
| 77 | | /// given to a successful `resize` call. |
| 78 | | /// |
| 79 | | /// `alignment` must equal the same value that was passed as the |
| 80 | | /// `alignment` parameter to the original `alloc` call. |
| 73 | /// `memory.len` must equal the length requested from the most recent |
| 74 | /// successful call to `alloc`, `resize`, or `remap`. `alignment` must |
| 75 | /// equal the same value that was passed as the `alignment` parameter to |
| 76 | /// the original `alloc` call. |
| 81 | 77 | /// |
| 82 | 78 | /// `ret_addr` is optionally provided as the first return address of the |
| 83 | 79 | /// allocation call stack. If the value is `0` it means no return address |