const_deallocate
: Don't deallocate memory allocated in an another const. Does nothing at runtime.
`const_allocate`: Returns a null pointer at runtime.
This commit is contained in:
parent
aa6795e2d4
commit
29932db09b
8 changed files with 69 additions and 11 deletions
|
@ -369,6 +369,16 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
|
|||
}
|
||||
}
|
||||
|
||||
sym::const_allocate => {
|
||||
// returns a null pointer at runtime.
|
||||
bx.const_null(bx.type_i8p())
|
||||
}
|
||||
|
||||
sym::const_deallocate => {
|
||||
// nop at runtime.
|
||||
return;
|
||||
}
|
||||
|
||||
// This requires that atomic intrinsics follow a specific naming pattern:
|
||||
// "atomic_<operation>[_<ordering>]", and no ordering means SeqCst
|
||||
name if name_str.starts_with("atomic_") => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue