From 040b36310a397075ea69548b5d8d88aa21e5bf83 Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Wed, 29 May 2024 09:43:28 -0600 Subject: [PATCH] Provide init function for initializing library (#11) --- src/LibAwsCommon.jl | 5 +++++ test/runtests.jl | 1 + 2 files changed, 6 insertions(+) diff --git a/src/LibAwsCommon.jl b/src/LibAwsCommon.jl index 30ff9b6..210510e 100644 --- a/src/LibAwsCommon.jl +++ b/src/LibAwsCommon.jl @@ -43,4 +43,9 @@ for name in names(@__MODULE__; all=true) @eval export $name end +function init(allocator=aws_default_allocator()) + aws_common_library_init(allocator) + return +end + end diff --git a/test/runtests.jl b/test/runtests.jl index 3decf7b..b68d9e8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,6 +7,7 @@ using Test, Aqua, LibAwsCommon end @testset "basic usage to test the library loads" begin allocator = aws_default_allocator() + LibAwsCommon.init(allocator) logpath = joinpath(mktempdir(), "log.txt") GC.@preserve logpath begin logger = Ref(aws_logger(C_NULL, C_NULL, C_NULL))