Commits

Michael Granger  committed 4d5e457

Use heap instead of stack for result array in #values, etc al. (refs #135, #136, #138)

  • Participants
  • Parent commits 72b4584

Comments (0)

Files changed (1)

File ext/pg_result.c

 	int field;
 	int num_rows = PQntuples(result);
 	int num_fields = PQnfields(result);
-	VALUE rows[ num_rows ];
+	VALUE ary = rb_ary_new2(num_rows);
 
 	for ( row = 0; row < num_rows; row++ ) {
 		VALUE new_row[ num_fields ];
 			}
 		}
 
-		rows[ row ] = rb_ary_new4( num_fields, new_row );
+		rb_ary_store( ary, row, rb_ary_new4(num_fields, new_row) );
 	}
 
-	return rb_ary_new4( num_rows, rows );
+	return ary;
 }