forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expands the API and reroutes all allocation through GlobalCtx
#10
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ies for sanitizers.
…ted allocation through `GlobalState`.
3d60e23
to
503d0b9
Compare
GlobalCtx
GlobalCtx
ARM linux is disabled in CI due to #6 |
obraunsdorf
approved these changes
Apr 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the second part of the change mentioned in #4. It's dependent on #9
New Types
Span
as a wrapper forusize
AllocId
as wrapper forusize
BorTag
as a wrapper forusize
AllocInfo
, a metadata object for each allocation. Contains the ID, base, bounds, size, alignment, andTree
for an allocation. The tree is currently a pointer toc_void
, as we haven't yet added the state of the borrow tracker.Provenance
, which contains anAllocID
, aBorTag
, and a pointer toAllocInfo
.GlobalState
toGlobalCtx
BsanAllocator
toBsanHooks
BsanAllocHook
fromBsanHooks
to use for anAllocator
implementation that's alsoCopy
Expanded Global State
Print
) and terminating (Exit
).print!
andprintln!
macros that useGlobalCtx
ui_test!
macro, which will print only if theui_test
feature is enabled.Hello, world!
UI test which verifies that we've initialized our runtime.BVec
,BHashMap
, andBVecDeque
wrappers that enforce use of theGlobalCtx
as an allocator.Additional API Functions
Provenance
valuesbsan_deinit
endpoint that deinitializes the state of the runtime. Called automatically on termination.bsan_shadow_copy
,bsan_shadow_clear
)bsan_push_frame
,bsan_pop_frame
)bsan_alloc
,bsan_dealloc
, andbsan_alloc_stack
)bsan_store_prov
,bsan_load_prov
)