fix OutOfMemory error
This commit is contained in:
parent
a822d01bd5
commit
0d86e399b6
3 changed files with 3 additions and 3 deletions
|
@ -27,7 +27,7 @@ pub const ExchangeConnection = struct {
|
||||||
listen_thread: Thread = undefined,
|
listen_thread: Thread = undefined,
|
||||||
|
|
||||||
pub fn init(host: []const u8, port: u16) !ExchangeConnection {
|
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);
|
var pba = heap.FixedBufferAllocator.init(&buf);
|
||||||
|
|
||||||
const addrList = try net.getAddressList(pba.allocator(), host, port);
|
const addrList = try net.getAddressList(pba.allocator(), host, port);
|
||||||
|
|
|
@ -15,7 +15,7 @@ pub fn main() !void {
|
||||||
var post_endpoints = endpoints.EndpointsManager{};
|
var post_endpoints = endpoints.EndpointsManager{};
|
||||||
var put_endpoints = endpoints.EndpointsManager{};
|
var put_endpoints = endpoints.EndpointsManager{};
|
||||||
|
|
||||||
std.debug.print("Init context: OK\n", .{});
|
std.debug.print("Init context\n", .{});
|
||||||
try ctx.init();
|
try ctx.init();
|
||||||
defer ctx.deinit();
|
defer ctx.deinit();
|
||||||
std.debug.print("Context: OK\n", .{});
|
std.debug.print("Context: OK\n", .{});
|
||||||
|
|
|
@ -37,7 +37,7 @@ pub const HttpService = struct {
|
||||||
mutex: Mutex,
|
mutex: Mutex,
|
||||||
|
|
||||||
pub fn init(id: u64, name: []const u8, host: []const u8, port: u16, num_connections: usize, allocator: Allocator) ServiceError!HttpService {
|
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);
|
var pba = heap.FixedBufferAllocator.init(&buf);
|
||||||
|
|
||||||
const addrList = net.getAddressList(pba.allocator(), host, port) catch return ServiceError.NotFound;
|
const addrList = net.getAddressList(pba.allocator(), host, port) catch return ServiceError.NotFound;
|
||||||
|
|
Loading…
Reference in a new issue