Skip to content

Commit

Permalink
make funcitons inline
Browse files Browse the repository at this point in the history
  • Loading branch information
Snikimonkd committed Jan 19, 2025
1 parent 94919a3 commit 3f1df22
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
15 changes: 6 additions & 9 deletions lib/std/threads/buffered_channel.c3
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,19 @@ fn void! BufferedChannel.destroy(&self)
return;
}

fn void! BufferedChannel.push(self, Type val)
fn void! BufferedChannel.push(self, Type val) @inline
{
BufferedChannelImpl* channel = (BufferedChannelImpl*)(self);
return channel.push(val);
return ((BufferedChannelImpl*)self).push(val) @inline;
}

fn Type! BufferedChannel.pop(self)
fn Type! BufferedChannel.pop(self) @inline
{
BufferedChannelImpl* channel = (BufferedChannelImpl*)(self);
return channel.pop();
return ((BufferedChannelImpl*)self).pop() @inline;
}

fn void! BufferedChannel.close(self)
fn void! BufferedChannel.close(self) @inline
{
BufferedChannelImpl* channel = (BufferedChannelImpl*)(self);
return channel.close();
return ((BufferedChannelImpl*)self).close() @inline;
}

struct BufferedChannelImpl @private
Expand Down
15 changes: 6 additions & 9 deletions lib/std/threads/unbuffered_channel.c3
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,19 @@ fn void! UnbufferedChannel.destroy(&self)
return;
}

fn void! UnbufferedChannel.push(self, Type val)
fn void! UnbufferedChannel.push(self, Type val) @inline
{
UnbufferedChannelImpl* channel = (UnbufferedChannelImpl*)(self);
return channel.push(val);
return ((UnbufferedChannelImpl*)self).push(val) @inline;
}

fn Type! UnbufferedChannel.pop(self)
fn Type! UnbufferedChannel.pop(self) @inline
{
UnbufferedChannelImpl* channel = (UnbufferedChannelImpl*)(self);
return channel.pop();
return ((UnbufferedChannelImpl*)self).pop() @inline;
}

fn void! UnbufferedChannel.close(self)
fn void! UnbufferedChannel.close(self) @inline
{
UnbufferedChannelImpl* channel = (UnbufferedChannelImpl*)(self);
return channel.close();
return ((UnbufferedChannelImpl*)self).close() @inline;
}

struct UnbufferedChannelImpl @private
Expand Down

0 comments on commit 3f1df22

Please sign in to comment.