diff --git a/website/api/duk_get_refcount.txt b/website/api/duk_get_refcount.txt new file mode 100644 index 00000000..bb318eb0 --- /dev/null +++ b/website/api/duk_get_refcount.txt @@ -0,0 +1,31 @@ +=proto +duk_size_t duk_get_refcount(duk_context *ctx, duk_idx_t index); + +=stack +[ ... val! ... ] + +=summary +

Get the internal reference count of a Duktape heap allocated value (object, +buffer, string) at index. Returns zero if the value is not heap +allocated, the index is invalid, or Duktape has been compiled without reference +counting.

+ +
+Avoid using this API call unless you have a really good reason to use it. +
+ +=example +duk_push_string(ctx, "dummy test"); +printf("refcount: %ld\n", (long) duk_get_refcount(ctx, -1)); + +=tags +stack +experimental + +=seealso +duk_get_heapptr +duk_require_heapptr +duk_push_heapptr + +=introduced +1.2.0