Skip to content

Commit

Permalink
chore: zig 0.14.0-dev.121+ab4c461b7
Browse files Browse the repository at this point in the history
  • Loading branch information
giann committed Jun 26, 2024
1 parent c183967 commit cacb1e6
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A small/lightweight statically typed scripting language written in Zig

## How to build and install

_Latest zig version supported: 0.13.0-dev.347+30a35a897_
_Latest zig version supported: 0.14.0-dev.121+ab4c461b7_

### Requirements
- Since this is built with Zig, you should be able to build buzz on a wide variety of architectures even though this has only been tested on x86/M1.
Expand Down
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn getBuzzPrefix(b: *Build) ![]const u8 {
pub fn build(b: *Build) !void {
// Check minimum zig version
const current_zig = builtin.zig_version;
const min_zig = std.SemanticVersion.parse("0.13.0-dev.347+30a35a897") catch return;
const min_zig = std.SemanticVersion.parse("0.14.0-dev.121+ab4c461b7") catch return;
if (current_zig.order(min_zig).compare(.lt)) {
@panic(b.fmt("Your Zig version v{} does not meet the minimum build requirement of v{}", .{ current_zig, min_zig }));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Token.zig
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn getLines(self: Self, allocator: mem.Allocator, before: usize, after: usiz
const before_index = if (self.line > 0) self.line - @min(before, self.line) else self.line;
const after_index = if (self.line > 0) self.line + after else self.line;

var it = std.mem.split(u8, self.source, "\n");
var it = std.mem.splitScalar(u8, self.source, '\n');
var current: usize = 0;
while (it.next()) |line| : (current += 1) {
if (current >= before_index and current <= after_index) {
Expand Down
2 changes: 1 addition & 1 deletion src/ext/clap
Submodule clap updated 3 files
+15 −0 README.md
+4 −4 clap.zig
+15 −0 example/README.md.template
6 changes: 3 additions & 3 deletions src/memory.zig
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub const GarbageCollector = struct {
next_gc: usize = if (builtin.mode == .Debug) 1024 else 1024 * BuildOptions.initial_gc,
next_full_gc: usize = if (builtin.mode == .Debug) 1024 else 1024 * BuildOptions.initial_gc,
last_gc: ?Mode = null,
objects: std.TailQueue(*Obj) = .{},
objects: std.DoublyLinkedList(*Obj) = .{},
gray_stack: std.ArrayList(*Obj),
active_vms: std.AutoHashMap(*VM, void),
// Obj being collected, useful to avoid setting object instance dirty while running its collector method
Expand Down Expand Up @@ -403,7 +403,7 @@ pub const GarbageCollector = struct {
}

fn addObject(self: *Self, obj: *Obj) !void {
const new_node = try self.allocator.create(std.TailQueue(*Obj).Node);
const new_node = try self.allocator.create(std.DoublyLinkedList(*Obj).Node);
new_node.* = .{
.data = obj,
};
Expand Down Expand Up @@ -937,7 +937,7 @@ pub const GarbageCollector = struct {
const swept: usize = self.bytes_allocated;

var obj_count: usize = 0;
var obj_node: ?*std.TailQueue(*Obj).Node = self.objects.first;
var obj_node: ?*std.DoublyLinkedList(*Obj).Node = self.objects.first;
var count: usize = 0;
while (obj_node) |node| : (count += 1) {
if (node.data.is_marked) {
Expand Down
2 changes: 1 addition & 1 deletion src/obj.zig
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub const Obj = struct {
is_marked: bool = false,
// True when old obj and was modified
is_dirty: bool = false,
node: ?*std.TailQueue(*Obj).Node = null,
node: ?*std.DoublyLinkedList(*Obj).Node = null,

pub inline fn cast(obj: *Obj, comptime T: type, obj_type: ObjType) ?*T {
if (obj.obj_type != obj_type) {
Expand Down
1 change: 0 additions & 1 deletion src/vm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1459,7 +1459,6 @@ pub const VM = struct {
switch (err) {
Error.RuntimeError => return,
else => {
std.debug.print("{}\n", .{err});
self.panic("Out of memory");
unreachable;
},
Expand Down

0 comments on commit cacb1e6

Please sign in to comment.