JFFI should have a debug mode to be brutally honest about pointer/memory misuse
-------------------------------------------------------------------------------
Key: JRUBY-3760
URL: http://jira.codehaus.org/browse/JRUBY-3760
Project: JRuby
Issue Type: Improvement
Components: JRuby-extras
Reporter: Mike Dalessio
After discussing some memory and pointer misuse with Wayne, I suggested that
JFFI have a debug-mode in which some memory types would be made inaccessible
(or NULL, or 0xdeadbeef) after their expected lifetime has expired.
Example misuse: I'm passing a String as a char*, and the underlying C code
saves that pointer for later use. Temporary copy FAIL.
In this case, JFFI could make inaccessibe the temporary memory allocated for
the invocation, so that when the saved pointer is eventually dereferenced, then
the segfault will let me know, in no uncertain terms, "Hey, developer dude, you
messed something up." As opposed to sometimes working / sometimes failing /
certainly being implementation-dependent / and therefore subject to abrupt and
inopportune changes in behavior.
Thank you for your time and kind indulgence.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email