We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7512030 commit 7050da8Copy full SHA for 7050da8
ext/symengine/ruby_rational.c
@@ -1,9 +1,11 @@
1
#include "ruby_rational.h"
2
3
VALUE crational_init(VALUE self, VALUE rat_value) {
4
- basic_struct *this, *num_basic, *den_basic;
5
- num_basic = basic_new_heap();
6
- den_basic = basic_new_heap();
+ basic_struct *this;
+ basic num_basic, den_basic;
+
7
+ basic_new_stack(num_basic);
8
+ basic_new_stack(den_basic);
9
10
Data_Get_Struct(self, basic_struct, this);
11
@@ -15,7 +17,7 @@ VALUE crational_init(VALUE self, VALUE rat_value) {
15
17
GET_SYMINTFROMVAL(den, den_basic);
16
18
19
rational_set(this, num_basic, den_basic);
- basic_free_heap(num_basic);
- basic_free_heap(den_basic);
20
+ basic_free_stack(num_basic);
21
+ basic_free_stack(den_basic);
22
return self;
23
}
ext/symengine/symengine_macros.c
@@ -2,7 +2,7 @@
#include "symengine.h"
void sympify(VALUE operand2, basic_struct *cbasic_operand2) {
- basic_struct *num_basic, *den_basic, *temp;
+ basic_struct *temp;
VALUE new_operand2, num, den;
switch(TYPE(operand2)) {
@@ -15,16 +15,17 @@ void sympify(VALUE operand2, basic_struct *cbasic_operand2) {
num = rb_funcall(operand2, rb_intern("numerator"), 0, NULL);
den = rb_funcall(operand2, rb_intern("denominator"), 0, NULL);
GET_SYMINTFROMVAL(num, num_basic);
24
25
rational_set(cbasic_operand2, num_basic, den_basic);
26
27
28
29
break;
30
31
case T_DATA:
0 commit comments