Skip to content

Commit

Permalink
Provide init function for initializing library (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj authored May 29, 2024
1 parent 9a7f198 commit 040b363
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/LibAwsCommon.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 040b363

Please sign in to comment.