diff --git a/src/regex/lib_pcre2.cr b/src/regex/lib_pcre2.cr index 0df60a05499b..13b451127985 100644 --- a/src/regex/lib_pcre2.cr +++ b/src/regex/lib_pcre2.cr @@ -207,8 +207,10 @@ lib LibPCRE2 fun get_ovector_pointer = pcre2_get_ovector_pointer_8(match_data : MatchData*) : LibC::SizeT* fun get_ovector_count = pcre2_get_ovector_count_8(match_data : MatchData*) : UInt32 - # void *private_malloc(Int, void *); - # void private_free(void *, void *); - fun general_context_create = pcre2_general_context_create_8(private_malloc : Void*, private_free : Void*, memory_data : Void*) : GeneralContext + fun general_context_create = pcre2_general_context_create_8( + private_malloc : LibC::SizeT, Void* -> Void, + private_free : Void*, Void* -> Void, + memory_data : Void* + ) : GeneralContext fun config = pcre2_config_8(what : UInt32, where : Void*) : Int end diff --git a/src/regex/pcre2.cr b/src/regex/pcre2.cr index 14b64e72546d..ba880ea6902f 100644 --- a/src/regex/pcre2.cr +++ b/src/regex/pcre2.cr @@ -135,7 +135,7 @@ module Regex::PCRE2 end class_getter general_context do - LibPCRE2.general_context_create(->(size : LibC::Int, data : Void*) { GC.malloc(size) }.pointer, ->(pointer : Void*, data : Void*) { GC.free(pointer) }.pointer, nil) + LibPCRE2.general_context_create(->(size, _data) { GC.malloc(size) }, ->(pointer, _data) { GC.free(pointer) }, nil) end # Returns a JIT stack that's shared in the current thread.