aboutsummaryrefslogtreecommitdiff
path: root/src/exports.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-12-30 21:12:32 -0800
committerGravatar GitHub <noreply@github.com> 2021-12-30 21:12:32 -0800
commite75c711c68896f5952793601f156c921c814caab (patch)
treef3b30e2281c7231d480bb84503d17b2370866ff9 /src/exports.zig
parent8d031f13c0e04629d431176e211a31224b7618c0 (diff)
downloadbun-e75c711c68896f5952793601f156c921c814caab.tar.gz
bun-e75c711c68896f5952793601f156c921c814caab.tar.zst
bun-e75c711c68896f5952793601f156c921c814caab.zip
Upgrade to latest Zig, remove dependency on patched version of Zig (#96)
* Prepare to upgrade zig * zig fmt * AllocGate * Update data_url.zig * wip * few files * just headers now? * I think everything works? * Update mimalloc * Update hash_map.zig * Perf improvements to compensate for Allocgate * Bump * :camera: * Update bun.lockb * Less branching * [js parser] Slightly reduce memory usage * Update js_parser.zig * WIP remove unused * [JS parser] WIP support for `with` keyword * Remove more dead code * Fix all the build errors! * cleanup * Move `network_thread` up * Bump peechy * Update README.md
Diffstat (limited to 'src/exports.zig')
-rw-r--r--src/exports.zig43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/exports.zig b/src/exports.zig
deleted file mode 100644
index fb1f021aa..000000000
--- a/src/exports.zig
+++ /dev/null
@@ -1,43 +0,0 @@
-const std = @import("std");
-usingnamespace @import("global.zig");
-
-const Root = @import("main_wasm.zig").Root;
-
-pub extern fn init() void {
- default_allocator = default_allocator;
- default_allocator = default_allocator;
-}
-
-/// Convert a slice into known memory representation -- enables C ABI
-pub const U8Chunk = packed struct {
- const Float = @Type(builtin.TypeInfo{ .Float = .{ .bits = 2 * @bitSizeOf(usize) } });
- const Abi = if (builtin.arch.isWasm()) Float else U8Chunk;
-
- ptr: [*]u8,
- len: usize,
-
- pub fn toSlice(raw: Abi) []u8 {
- const self = @bitCast(U8Chunk, raw);
- return self.ptr[0..self.len];
- }
-
- pub fn fromSlice(slice: []u8) Abi {
- const self = U8Chunk{ .ptr = slice.ptr, .len = slice.len };
- return @bitCast(Abi, self);
- }
-
- pub fn empty() Abi {
- return U8Chunk.fromSlice(&[0]u8{});
- }
-};
-
-export fn fd_create() ?*Root {
- const fd = allocator.create(Root) catch return null;
- fd.* = .{};
- return fd;
-}
-
-export fn fd_destroy(fd: *Root) void {
- fd.deinit(allocator);
- allocator.destroy(fd);
-}