Skip to content

Commit

Permalink
fix to_strin someg methods
Browse files Browse the repository at this point in the history
  • Loading branch information
StunxFS committed Jan 26, 2024
1 parent 2b06eec commit 068144e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/core/src/int.ri
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extend int32 < Stringable {
}
unsafe {
mut index := @as(uint, max);
buf := @as([&]mut uint8, mem.raw_alloc(index + 1));
buf := @as([&]mut uint8, mem.boxed_alloc(index + 1));
buf[index] = 0;
index -= 1;

Expand Down Expand Up @@ -116,7 +116,7 @@ extend int64 < Stringable {
unsafe {
max := 20;
mut index := @as(uint, max);
buf := @as([&]mut uint8, mem.raw_alloc(index + 1));
buf := @as([&]mut uint8, mem.boxed_alloc(index + 1));
buf[index] = 0;
index -= 1;

Expand Down
2 changes: 1 addition & 1 deletion lib/core/src/rune.ri
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ extend rune < Stringable {

pub func to_string(&self) -> string {
len := self.len_utf8();
res := unsafe { @as([&]mut uint8, mem.raw_alloc(len + 1)) };
res := unsafe { @as([&]mut uint8, mem.boxed_alloc(len + 1)) };
unsafe {
_ = utf32_decode_to_buffer(self.*, res);
return string.from_raw_with_len(res, len);
Expand Down
4 changes: 2 additions & 2 deletions lib/core/src/uint.ri
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ extend uint32 < Stringable {
mut d: uint32 := 0;

mut index := max;
buf := @as([&]mut uint8, mem.raw_alloc(max + 1));
buf := @as([&]mut uint8, mem.boxed_alloc(max + 1));
buf[index] = 0;
index -= 1;

Expand Down Expand Up @@ -170,7 +170,7 @@ extend uint64 < Stringable {

max := 20;
mut index := @as(uint, max);
buf := @as([&]mut uint8, mem.raw_alloc(index + 1));
buf := @as([&]mut uint8, mem.boxed_alloc(index + 1));
buf[index] = 0;
index -= 1;

Expand Down

0 comments on commit 068144e

Please sign in to comment.