この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

Obsolete since JSAPI 5
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The JavaScript engine calls the JSClass.mark callback during the mark phase of garbage collection.

JSMarkOp is the type of the JSClass.mark callback in SpiderMonkey 1.7 and earlier. In SpiderMonkey 1.8, JSMarkOp will be deprecated. All new code using SpiderMonkey 1.8 or later should use a JSTraceOp instead to ensure that the tracing APIs work properly.


typedef uint32 (*JSMarkOp)(JSContext *cx, JSObject *obj, void *arg);
Name Type Description
cx JSContext * The JS context in which the mark phase of garbage collection is occurring.
obj JSObject * The object to be marked.
arg void * Opaque data which the mark hook must pass through to JS_MarkGCThing.


Call JS_MarkGCThing for each GC thing directly reachable from obj. Use JSVAL_IS_GCTHING to check whether a value needs to be marked and JSVAL_TO_GCTHING to convert the jsval to a pointer.

Document Tags and Contributors

Contributors to this page: tschneidereit, ethertank, Jorend
最終更新者: tschneidereit,