Changed xfree to NM_FREE, which calls xfree.
switched allocation macros to NM_ALLOC style macros

These new macros will just call the ruby ones.  This should help make debugging
memory issues easier since these can be replaced or instrumented temporarily
while debugging.
Initial work in progress on new GC interaction strategy

New Plan:

Instead of using volatile all the time, do the following:

 - as necessary, wrap values in use in a ruby object that the GC knows to mark.
   At the moment this is done using a single wrapped linked list of values that
   knows how to mark all of the linked values.  There are probably more
   efficient ways to do this, but this is simple and will suffice for getting
   this off the ground.

 - otheriwse, use the rb_gc_register and rb_gc_unregister functions to tell the
   gc regions of VALUE*s that are in use.

The initial work in progress has implemented all the registration functions for
dense storage and generally for VALUEs and inserted these registrations as
neccessary in ruby_nmatrix.c.  The conversion still needs to be done elsewhere.
Initial conversion of dense storage to new gc interaction scheme

This is still segfaulting on test code, so the conversion is either missing
something in dense or still depends on other files not converted.
fix segfault due to unregister after free

Also fixed a leak in nm_init where alternate return paths did not unregister
values.

This commit no longer segfaults on the memory testing code.

Still need to convert yale and list storage.

Also need to do performance checks to see if this new scheme has slowed down
the code.
Performance improvements for gc interaction code

On my elementwise-op-heavy test code, the previous implementation of value
registration resulted in about a 30-35% slowdown.

Changed the registration methods so that they all use the nm_gc_holder struct
scheme, and changed this to hold a pointer and a count rather than the value
itself. This allows arrays of VALUEs to be marked with only a single allocation
rather than one per value (as was happening with rb_gc_register_address calls).
Also implemented object pooling for the nm_gc_holder structs so that these get
reused when a VALUE is unregistered.  (Memory allocation was previously the
bottleneck here, and pooling avoids that.)

Slowdown is now approximately 5%.  Still needs to be tested on other operations
to make sure there aren't unacceptable slowdowns elsewhere.
Specs for issue #152 and issue #153, fix for issue #153

The list storage slice_set method never incremented v_offset, so when setting a
(non-single) slice, every value would be set to the first value in the rhs
array.

The specs are now segfaulting on list stype, which I suspect is related to
Merge branch 'issue_152' into gc_management

Conflicts:
	ext/nmatrix/storage/list.cpp

Some lines had changes both related to issue 153 and using NM_ALLOC.  These now
incorporate both changes.
list matrix gc and bug fixes

- Implemented gc registration for list matrices.  Still needs more extensive
  testing on more complicated code.

- Fixed a few bugs related to iterating on slices by reference for list
  matrices.  Within the list code, some locations do recursion starting with 0
  and counting up; others do it starting with dim-1 and counting down.  Offsets
  needed to be adjusted accordingly; previously some locations were using slice
  offsets for dimensions ordered in reverse.

- Fixed #152 by matching sype during iteration.

Some stat-function-related list and yale bugs remain, but these can be dealt
with separately.

(Sorry for the multi-bug commit, but I needed to fix all of these at the same
time for all the specs not to fail or segfault, and I needed the specs to make
sure I hadn't introduced regressions.)
fix ewise op regression for list

Remove temporary editor files accidentally committed.
Change stddev to use .sqrt instead of a manual map block.

Delete editor temp file inadvertantly committed.
Argh.  Remove another temp file accidentally committed.
remove another temp file
fix list matrix iteration and conversion bug

- List and Yale matrices with a single dimension of length 1 would fail to iterate in
  each_stored_with_indices and doesn't set the default value.  Fallback to
  each_with_indices fixes this for now.  It would probably be better to fix
  this in the C code directly, but I still need to figure out how to do that
  without breaking other things.

- List and Yale matrices would fail to convert from complex to non-complex
  dtype because of a failing default value conversion.  Added a method to fix
  this in the ruby code when calling cast.  This might be better fixed at some
  point by changing how rubyval_to_cval works.
Added gc management code to yale matrices.

This should complete the conversion to the new gc-management system.

Yale and list matrices are working, but I don't have extensive code using
sparse matrices to stress test these, so more testing would be helpful.
Adding additional highly conservative gc registrations

Testing code still shows very, very rare segfaults for dense matrices (no data
yet on yale/list).
final gc interaction additions

Found some final places where gc registrations were missing.

 - In checking whether a block was passed in RETURN_SIZED_ENUMERATOR, the ruby
   api is called.  This has now been split into two macros to allow insertion
   of unregistration code so that memory isn't leaked.

 - Most imporantly: GC can happen during Data_Wrap_Struct, so registrations
   have to be kept until after this call returns.  This was fixed throughout
   the code.

 - other miscellaneous locations where I'd missed a hidden ruby api call

 This no longer segfaults on my complex testing code.  Better sparse matrix
 stress testing is still needed.  I don't have any large programs lying around
 that use sparse matrices.
Merge branch 'master' of git://github.com/SciRuby/nmatrix into gc_management
Marked GC-interaction internals as static.

The functions in ruby_nmatrix.c prefaced with __ should have been static and
were not.
Merge pull request #160 from cjfuller/gc_management

GC Management Changes (also list/yale inject rank, slicing bugfixes)