Skip to content

Commit

Permalink
adds jv_return
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilian committed Feb 27, 2024
1 parent 72ef180 commit b80e4f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/jv.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ static inline void jv_free(jv a){if(!a.borrowed) jv__free(a);}

static inline jv jv_borrow(jv a){a.borrowed = 1; return a;}
static inline jv jv_unborrow(jv a){a.borrowed = 0; return jv_copy(a);}
static inline jv jv_return(jv a){if(a.borrowed) return jv_unborrow(a); return a;}

int jv_get_refcnt(jv);

Expand Down

0 comments on commit b80e4f0

Please sign in to comment.