wingo pushed a commit to branch lightning
in repository guile.

commit 0d96d24073bbe42054d7de6a7739b9db07d54e96
Author: pcpa <[email protected]>
Date:   Sun Jul 27 16:45:03 2014 -0300

    Add note about jit_set_memory_functions call.
    
        * doc/body.texi: Add note that jit_set_memory_functions
        should be called before init_jit, because init_jit
        itself may call the memory wrappers.
---
 ChangeLog     | 6 ++++++
 doc/body.texi | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 79bdd6f..af99cd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-07-27 Paulo Andrade <[email protected]>
+
+       * doc/body.texi: Add note that jit_set_memory_functions
+       should be called before init_jit, because init_jit
+       itself may call the memory wrappers.
+
 2014-04-22 Paulo Andrade <[email protected]>
 
        * lib/jit_arm.c: Do not get confused with default settings
diff --git a/doc/body.texi b/doc/body.texi
index a1a4659..81b8798 100644
--- a/doc/body.texi
+++ b/doc/body.texi
@@ -1293,6 +1293,11 @@ for @code{free} or @code{old_size} for @code{realloc}.
 using these wrapped functions, but you must note that if lightning
 was linked to GNU binutils, malloc is probably will be called multiple
 times from there when initializing the disassembler.
+
+Because @code{init_jit} may call memory functions, if you need to call
+@code{jit_set_memory_functions}, it must be called before @code{init_jit},
+otherwise, when calling @code{finish_jit}, a pointer allocated with the
+previous or default wrappers will be passed.
 @end deftypefun
 
 @deftypefun void jit_get_memory_functions (@* void *(**@var{alloc_func_ptr}) 
(size_t), @* void *(**@var{realloc_func_ptr}) (void *, size_t), @* void 
(**@var{free_func_ptr}) (void *))

Reply via email to