Skip to content

Instantly share code, notes, and snippets.

@methodmissing
Created October 2, 2008 01:13
Show Gist options
  • Select an option

  • Save methodmissing/14249 to your computer and use it in GitHub Desktop.

Select an option

Save methodmissing/14249 to your computer and use it in GitHub Desktop.
static VALUE mysqlres2obj(MYSQL_RES* res)
{
VALUE obj;
struct mysql_res* resp;
obj = Data_Make_Struct(cMysqlRes, struct mysql_res, 0, free_mysqlres, resp);
rb_iv_set(obj, "colname", Qnil);
rb_iv_set(obj, "tblcolname", Qnil);
resp->res = res;
resp->freed = Qfalse;
rb_obj_call_init(obj, 0, NULL);
if (++store_result_count > GC_STORE_RESULT_LIMIT)
rb_gc();
return obj;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment