mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Revert "Add __cxa_throw to utils"
This reverts commit 23f4802b8773043bd0bb32cdf2f235d023a38050.
This commit is contained in:
parent
b02ae3794f
commit
2a68c0c2cd
1 changed files with 0 additions and 9 deletions
|
@ -1,10 +1,6 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const always_inline = std.builtin.CallOptions.Modifier.always_inline;
|
const always_inline = std.builtin.CallOptions.Modifier.always_inline;
|
||||||
|
|
||||||
// Throwing an exception, from libc++
|
|
||||||
// https://github.com/llvm-mirror/libcxxabi/blob/ce3db128f9e4d6d19d1cdbe39bb45fcc64a5adb0/src/cxa_exception.cpp#L230
|
|
||||||
extern fn __cxa_throw(thrown_exception: *c_void, type_info: *c_void, dest: *c_void) callconv(.C) void;
|
|
||||||
|
|
||||||
// If allocation fails, this must cxa_throw - it must not return a null pointer!
|
// If allocation fails, this must cxa_throw - it must not return a null pointer!
|
||||||
extern fn roc_alloc(alignment: usize, size: usize) callconv(.C) *c_void;
|
extern fn roc_alloc(alignment: usize, size: usize) callconv(.C) *c_void;
|
||||||
|
|
||||||
|
@ -17,17 +13,12 @@ extern fn roc_dealloc(alignment: usize, c_ptr: *c_void) callconv(.C) void;
|
||||||
|
|
||||||
comptime {
|
comptime {
|
||||||
if (std.builtin.is_test) {
|
if (std.builtin.is_test) {
|
||||||
@export(testing_cxa_throw, .{ .name = "__cxa_throw", .linkage = .Strong });
|
|
||||||
@export(testing_roc_alloc, .{ .name = "roc_alloc", .linkage = .Strong });
|
@export(testing_roc_alloc, .{ .name = "roc_alloc", .linkage = .Strong });
|
||||||
@export(testing_roc_realloc, .{ .name = "roc_realloc", .linkage = .Strong });
|
@export(testing_roc_realloc, .{ .name = "roc_realloc", .linkage = .Strong });
|
||||||
@export(testing_roc_dealloc, .{ .name = "roc_dealloc", .linkage = .Strong });
|
@export(testing_roc_dealloc, .{ .name = "roc_dealloc", .linkage = .Strong });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn testing_cxa_throw(thrown_exception: *c_void, type_info: *c_void, dest: *c_void) callconv(.C) void {
|
|
||||||
std.debug.panic("An exception was thrown during this test!");
|
|
||||||
}
|
|
||||||
|
|
||||||
fn testing_roc_alloc(alignment: usize, size: usize) callconv(.C) *c_void {
|
fn testing_roc_alloc(alignment: usize, size: usize) callconv(.C) *c_void {
|
||||||
return @ptrCast(*c_void, std.testing.allocator.alloc(u8, size) catch unreachable);
|
return @ptrCast(*c_void, std.testing.allocator.alloc(u8, size) catch unreachable);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue