Open SchrodingerZhu opened 1 year ago
@digama0 I change this PR to remove *_locked
initializations. I also found a problem in previous tests where initialization can be called multiple times. At least for small_allocator
, such repeated initialization means that previously allocated pages are leaked.
@digama0 So,
parking_lot
still requiresstd
, which is annoying. This PR provides a potential fix.However, I suggest we should completely remove the
*_locked
things. It is hardly useful to provide such locked routines. Users cannot call it multiple times, even if it is locked. Users still struggle to maintain the status to check ifLean
is already initialized. Also, the user may initialize their own pieces betweenlean_initialize
andio_mark_end_initialization
, where exclusivity is required during the whole time, but these*_locked
things simply release the lock after the first function call.As in this low-level
lean-sys,
I think just providing theunsafe
initialization routine is fine.