fix OutOfMemory error

This commit is contained in:
Marcos Uchoa 2025-08-08 00:43:34 -03:00
parent a822d01bd5
commit 0d86e399b6
3 changed files with 3 additions and 3 deletions

View file

@ -27,7 +27,7 @@ pub const ExchangeConnection = struct {
listen_thread: Thread = undefined,
pub fn init(host: []const u8, port: u16) !ExchangeConnection {
var buf: [1024]u8 = undefined;
var buf: [4096]u8 = undefined;
var pba = heap.FixedBufferAllocator.init(&buf);
const addrList = try net.getAddressList(pba.allocator(), host, port);

View file

@ -15,7 +15,7 @@ pub fn main() !void {
var post_endpoints = endpoints.EndpointsManager{};
var put_endpoints = endpoints.EndpointsManager{};
std.debug.print("Init context: OK\n", .{});
std.debug.print("Init context\n", .{});
try ctx.init();
defer ctx.deinit();
std.debug.print("Context: OK\n", .{});

View file

@ -37,7 +37,7 @@ pub const HttpService = struct {
mutex: Mutex,
pub fn init(id: u64, name: []const u8, host: []const u8, port: u16, num_connections: usize, allocator: Allocator) ServiceError!HttpService {
var buf: [1024]u8 = undefined;
var buf: [4096]u8 = undefined;
var pba = heap.FixedBufferAllocator.init(&buf);
const addrList = net.getAddressList(pba.allocator(), host, port) catch return ServiceError.NotFound;