From 6c988c38047221c33e764a190a1e312d2c02ac37 Mon Sep 17 00:00:00 2001 From: dzaima Date: Sat, 22 Apr 2023 12:41:34 +0300 Subject: [PATCH] ptr_incBy --- src/h.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/h.h b/src/h.h index 42bb7b57..e2ba4a65 100644 --- a/src/h.h +++ b/src/h.h @@ -667,6 +667,7 @@ static inline B incBy(B x, i64 am) { // you most likely don't want am to be nega } static inline B incByG(B x, i64 am) { v(x)->refc+= am; return x; } #define ptr_inc(X) ({ AUTO x_ = (X); VALIDATEP((Value*)x_)->refc++; x_; }) +#define ptr_incBy(X, AM) ({ AUTO x_ = (X); VALIDATEP((Value*)x_)->refc+= (i64)(AM); x_; })