rename uc_context_free() to uc_mem_free(). see #373
This commit is contained in:
@ -117,7 +117,7 @@ instance Storable MemoryRegion where
|
||||
|
||||
-- | Opaque storage for CPU context, used with the context functions.
|
||||
{# pointer *uc_context as Context
|
||||
foreign finalizer uc_context_free_wrapper as contextFree
|
||||
foreign finalizer uc_mem_free_wrapper as memFree
|
||||
newtype
|
||||
#}
|
||||
|
||||
@ -125,11 +125,11 @@ instance Storable MemoryRegion where
|
||||
{# pointer *uc_context as ContextPtr -> Context #}
|
||||
|
||||
-- | Make a CPU context out of a context pointer. The returned CPU context will
|
||||
-- automatically call 'uc_context_free' when it goes out of scope.
|
||||
-- automatically call 'uc_mem_free' when it goes out of scope.
|
||||
mkContext :: ContextPtr
|
||||
-> IO Context
|
||||
mkContext ptr =
|
||||
liftM Context (newForeignPtr contextFree ptr)
|
||||
liftM Context (newForeignPtr memFree ptr)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
-- Emulator control
|
||||
|
@ -7,6 +7,6 @@ void uc_close_wrapper(uc_engine *uc) {
|
||||
void uc_close_dummy(uc_engine *uc) {
|
||||
}
|
||||
|
||||
void uc_context_free_wrapper(uc_context *context) {
|
||||
uc_context_free(context);
|
||||
void uc_mem_free_wrapper(void *mem) {
|
||||
uc_mem_free(mem);
|
||||
}
|
||||
|
@ -14,8 +14,8 @@ void uc_close_wrapper(uc_engine *uc);
|
||||
void uc_close_dummy(uc_engine *uc);
|
||||
|
||||
/*
|
||||
* Wrap Unicorn's uc_context_free function and ignore the returned error code.
|
||||
* Wrap Unicorn's uc_mem_free function and ignore the returned error code.
|
||||
*/
|
||||
void uc_context_free_wrapper(uc_context *context);
|
||||
void uc_mem_free_wrapper(void *context);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user