> From: Paul Smith <[email protected]> > Cc: Eli Zaretskii <[email protected]>, "[email protected]" <[email protected]> > Date: Mon, 29 Apr 2013 16:16:40 -0400 > > It's probably a good idea for make to provide a "gmk_free()" function > that will free memory returned to the plugin when it calls gmk_*() > functions such as gmk_expand(). Is that sufficient to deal with this > problem?
Yes, I think so. > Suppose, for example, we enhanced gmk_expand() to take a buffer and a > plugin invoked: > > gmk_expand(buf, buflen, "$(info expanding) $(FOO)"); > > This will return the expansion of the FOO variable, but it will ALSO > print "expanding" as the result of calling the info function. Now > suppose that the result of expanding $(FOO) was too large to fit into > buf, so the function returns the length needed and the plugin > reallocates the buffer to be large enough and re-invokes gmk_expand()... > now it will print "expanding" AGAIN. This could be solved, but I think providing gmk_free is much simpler and will suffice. _______________________________________________ Bug-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-make
