P2: later
An appendix to the milestone.
P2: for later
-
PAGEcarries no unit. DONE (PAGE_BYTES). Finding:const PAGE: u64 = 4096is a length; the units rule says a length carries its unit (MAXIMUM_NAME_BYTES, neverMAXIMUM_NAME_LEN).address_space_layoutandc_seamspell it the same way, so this is a tree habit, not one crate's slip.MINIMUM_GROW_PAGEScounts things and is right. Evidence:src/lib.rsline 31. Change:PAGE_BYTES, private, in this crate; the sibling crates in their own reviews. Door: two-way (private). Effort: XS. -
A panic inside the allocator holds the lock. DONE (the default handler,
user_mode_runtime::panic_handler!, ignores the message and traps, so it never allocates; the type's doc says so). Finding: talc'sdebug_assert!s run in debug builds insidealloc,deallocandreallocwhilelockedistrue. If the user-mode panic handler allocates (unverified: it was not read for this), a debug-build allocator panic spins forever in the handler instead of faulting legibly. There is no unwinding on these targets, so the lock is never released by aDropon the way out either. Evidence:src/lib.rslines 62 to 76 and 241 to 288. Change: read the handler. If it allocates, say so in the README and in the handler's doc, or give the heap atry_lockthe handler can use to print without allocating. Door: two-way. Effort: XS to read, S to change. -
Growth is monotonic and the README should say so. DONE (the crate docs and the README say the heap never shrinks; the README's BUGS section names the missing unmap call). Finding: talc's
truncateis never called, and the memory-region interface has no per-page return (MAP,RETYPE,RETYPE_OBJECT,SPLIT,DESTROY,USAGE), so a heap that peaked holds its peak until the region's owner destroys it. glibc trims.dlmallocandrlsfrelease pages. A stranger from any of them will expect a high-water mark that falls. Evidence:crates/moho_abi/src/memory_region.rs.src/lib.rs(no call totruncate). Change: one README sentence, and a BUGS line in the crate for the day the interface grows a return. Door: two-way. Effort: XS. -
No accessor for the cap or the base. DONE (
maximum_bytesandbase_virtual_address, provisional). Finding:committed_bytesexists.maximum_bytesandbase_virtual_addressdo not, so a test or an operator cannot ask what cap is in force after a rounding or a secondinitialize. Evidence:src/lib.rslines 126 to 131. Change: two accessors, named with the architect in Decision A's table. Door: one-way (public names). Effort: XS. -
The
unsafe impl Syncand the guard are sound, and the argument deserves one written statement. DONE (the concurrency paragraph on the type). Finding:Guard::inner(&mut self)hands out&mut Innerfrom anUnsafeCellunder a compare-exchange spinlock withAcquireon take andReleaseon drop. The pairing is right, the&mut selfreceiver stops two live&mut Innerfrom one guard, andgrowallocates nothing while holding the lock. The SAFETY comments say "all access goes through the lock" and stop there. Nothing states thatInneris otherwise!Syncbecause of talc's raw pointers, or that noSourceor signal-like upcall may use the heap. Evidence:src/lib.rslines 59 to 76. Change: one paragraph on the type: what the lock protects, whyInnerneeds it, and the two re-entrancy rules. No code change. Door: two-way. Effort: XS.