Skip to content

Commit 1b8ea07

Browse files
committed
Add const_allocate and const_deallocate intrinsics
1 parent 3ff158e commit 1b8ea07

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/intrinsics/mod.rs

+10
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,16 @@ fn codegen_regular_intrinsic_call<'tcx>(
10201020
ret.write_cvalue(fx, CValue::by_val(is_eq_value, ret.layout()));
10211021
};
10221022

1023+
const_allocate, (c _size, c _align) {
1024+
// returns a null pointer at runtime.
1025+
let null = fx.bcx.ins().iconst(fx.pointer_type, 0);
1026+
ret.write_cvalue(fx, CValue::by_val(null, ret.layout()));
1027+
};
1028+
1029+
const_deallocate, (c _ptr, c _size, c _align) {
1030+
// nop at runtime.
1031+
};
1032+
10231033
black_box, (c a) {
10241034
// FIXME implement black_box semantics
10251035
ret.write_cvalue(fx, a);

0 commit comments

Comments
 (0)