Add functions needed for switch ref-counting fix

This commit is contained in:
Michal Moskal 2017-12-11 14:48:34 +00:00
parent 26680823ff
commit b673108852

View File

@ -29,6 +29,15 @@ namespace String_ {
return 0;
}
//%
int compareDecr(StringData *s, StringData *that) {
int r = compare(s, that);
if (r == 0)
decr((uint32_t)that);
return r;
}
//%
int length(StringData *s) { return s->len; }
@ -112,6 +121,15 @@ namespace Number_ {
int div(int x, int y) { return x / y; }
//%
int mod(int x, int y) { return x % y; }
//%
bool eqDecr(int x, int y) {
if(x == y) {
decr(y);
return true;
}
return false;
}
}
namespace Math_ {