FFI::MemoryPointer becomes unwritable
-------------------------------------
Key: JRUBY-4916
URL: http://jira.codehaus.org/browse/JRUBY-4916
Project: JRuby
Issue Type: Improvement
Environment: jruby 1.6.0.dev (ruby 1.8.7 patchlevel 249) (2010-06-30
2d1eff7) (Java HotSpot(TM) Client VM 1.6.0_18) [x86-java]
screenshot gem v 0.0.4
Reporter: Roger Pack
Assignee: Thomas E Enebo
This code:
require 'rubygems'
require "benchmark"
require 'win32/screenshot'
t = "Internet Explorer"
Benchmark.bmbm do |x|
x.report("no file") {50.times {Win32::Screenshot.window(t, 0) {}}}
end
Eventually crashes [1] in jruby, because a MemoryPointer appears to suddenly be
unwritable.
It succeeds well with MRI.
Maybe jruby's underlying FFI implementation should do its own memory
management, like calling out to malloc and free, to avoid Java's GC (which I
assume is the cause [2]).
-r
[1] http://gist.github.com/458719
[2] http://wiki.github.com/ffi/ffi/core-concepts#memory
--
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