Subject: Re: [ruby-ffi] Re: segfault on windows MRI but not windows JRuby |
From: Wayne Meissner |
Date: 12/4/09 2:31 PM |
To: ruby-ffi@googlegroups.com |
2009/12/5 Jon <jon.forums@gmail.com>:
Fixed, thank you. I should also update all samples to check for null pointers from calloc (and nil from MemoryPointer.new ??).
You need to check return values from calloc/malloc (just like any other C function), but MemoryPointer.new will throw NoMemError if it fails.