• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ rb_gc_mark函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中rb_gc_mark函数的典型用法代码示例。如果您正苦于以下问题:C++ rb_gc_mark函数的具体用法?C++ rb_gc_mark怎么用?C++ rb_gc_mark使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rb_gc_mark函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Game_mark

static void
Game_mark(Game* game)
{
  if (game && !NIL_P(game->screen)) {
    rb_gc_mark(game->screen);
  }
}
开发者ID:CaptainJet,项目名称:RM-StarRuby,代码行数:7,代码来源:game.c


示例2: vm_mark_each_thread_func

static int
vm_mark_each_thread_func(st_data_t key, st_data_t value, st_data_t dummy)
{
    VALUE thval = (VALUE)key;
    rb_gc_mark(thval);
    return ST_CONTINUE;
}
开发者ID:qnighy,项目名称:ruby-1.9.2p0,代码行数:7,代码来源:vm.c


示例3: frame_mark_i

static int
frame_mark_i(st_data_t key, st_data_t val, st_data_t arg)
{
    VALUE frame = (VALUE)key;
    rb_gc_mark(frame);
    return ST_CONTINUE;
}
开发者ID:agrimm,项目名称:stackprof,代码行数:7,代码来源:stackprof.c


示例4: context_mark

static void
context_mark(void *data)
{
  debug_context_t *context = (debug_context_t *) data;

  rb_gc_mark(context->backtrace);
}
开发者ID:guilherme,项目名称:byebug,代码行数:7,代码来源:context.c


示例5: oci8_lob_mark

static void oci8_lob_mark(oci8_base_t *base)
{
    oci8_lob_t *lob = (oci8_lob_t *)base;
    if (lob->svcctx != NULL) {
        rb_gc_mark(lob->svcctx->base.self);
    }
}
开发者ID:Captnwalker1,项目名称:ruby-oci8,代码行数:7,代码来源:lob.c


示例6: mark

static void mark(xmlNodePtr node)
{
  /* it's OK if the document isn't fully realized (as in XML::Reader). */
  /* see http://github.com/tenderlove/nokogiri/issues/closed/#issue/95 */
  if (DOC_RUBY_OBJECT_TEST(node->doc) && DOC_RUBY_OBJECT(node->doc))
    rb_gc_mark(DOC_RUBY_OBJECT(node->doc));
}
开发者ID:AdamDotCom,项目名称:my-rvm,代码行数:7,代码来源:xml_node.c


示例7: rb_grn_database_mark_existing_ruby_object

static void
rb_grn_database_mark_existing_ruby_object (grn_ctx *context, grn_obj *database)
{
    grn_table_cursor *cursor;
    grn_id id;

    cursor = grn_table_cursor_open(context, database, NULL, 0, NULL, 0,
				   0, -1, GRN_CURSOR_ASCENDING);
    if (!cursor)
	return;

    while ((id = grn_table_cursor_next(context, cursor)) != GRN_ID_NIL) {
	grn_obj *object;
	grn_user_data *user_data;
	RbGrnObject *rb_grn_object;

	object = grn_ctx_at(context, id);
	if (!object)
	    continue;
	user_data = grn_obj_user_data(context, object);
	if (!user_data)
	    continue;
	rb_grn_object = RB_GRN_OBJECT(user_data->ptr);
	if (!rb_grn_object)
	    continue;
	rb_gc_mark(rb_grn_object->self);
    }
    grn_table_cursor_close(context, cursor);
}
开发者ID:ryoqun,项目名称:rroonga,代码行数:29,代码来源:rb-grn-database.c


示例8: cont_mark

static void
cont_mark(void *ptr)
{
    RUBY_MARK_ENTER("cont");
    if (ptr) {
	rb_context_t *cont = ptr;
	rb_gc_mark(cont->value);
	rb_thread_mark(&cont->saved_thread);

	if (cont->vm_stack) {
#ifdef CAPTURE_JUST_VALID_VM_STACK
	    rb_gc_mark_locations(cont->vm_stack,
				 cont->vm_stack + cont->vm_stack_slen + cont->vm_stack_clen);
#else
	    rb_gc_mark_localtion(cont->vm_stack,
				 cont->vm_stack, cont->saved_thread.stack_size);
#endif
	}

	if (cont->machine_stack) {
	    rb_gc_mark_locations(cont->machine_stack,
				 cont->machine_stack + cont->machine_stack_size);
	}
#ifdef __ia64
	if (cont->machine_register_stack) {
	    rb_gc_mark_locations(cont->machine_register_stack,
				 cont->machine_register_stack + cont->machine_register_stack_size);
	}
#endif
    }
    RUBY_MARK_LEAVE("cont");
}
开发者ID:3runo5ouza,项目名称:rhodes,代码行数:32,代码来源:cont.c


示例9: helium_rb_callback

void helium_rb_callback(const helium_connection_t *conn, uint64_t sender_mac, char * const message, size_t n)
{
  struct helium_queued_callback queued = {
    .sender_mac = sender_mac,
    .message = malloc(n),
    .count = n,
    .conn = (helium_connection_t *)conn,
    .mutex = PTHREAD_MUTEX_INITIALIZER,
    .cond = PTHREAD_COND_INITIALIZER,
    .next = NULL
  };

  memcpy(queued.message, message, n);

  add_queued_callback(&queued);

  pthread_cond_signal(&g_callback_cond);

  pthread_mutex_lock(&queued.mutex);
  pthread_cond_wait(&queued.cond, &queued.mutex);
  pthread_mutex_unlock(&queued.mutex);
}

void helium_rb_mark(void * p) {
  helium_connection_t *conn = (helium_connection_t*)p;
  // make sure we mark the callback proc too so it doesn't get GCed
  rb_gc_mark(helium_get_context(conn));
}
开发者ID:helium,项目名称:rbhelium,代码行数:28,代码来源:helium_ext.c


示例10: rb_vm_mark

void
rb_vm_mark(void *ptr)
{
    int i;

    RUBY_MARK_ENTER("vm");
    RUBY_GC_INFO("-------------------------------------------------\n");
    if (ptr) {
	rb_vm_t *vm = ptr;
	if (vm->living_threads) {
	    st_foreach(vm->living_threads, vm_mark_each_thread_func, 0);
	}
	RUBY_MARK_UNLESS_NULL(vm->thgroup_default);
	RUBY_MARK_UNLESS_NULL(vm->mark_object_ary);
	RUBY_MARK_UNLESS_NULL(vm->load_path);
	RUBY_MARK_UNLESS_NULL(vm->loaded_features);
	RUBY_MARK_UNLESS_NULL(vm->top_self);
	RUBY_MARK_UNLESS_NULL(vm->coverages);
	rb_gc_mark_locations(vm->special_exceptions, vm->special_exceptions + ruby_special_error_count);

	if (vm->loading_table) {
	    rb_mark_tbl(vm->loading_table);
	}

	mark_event_hooks(vm->event_hooks);

	for (i = 0; i < RUBY_NSIG; i++) {
	    if (vm->trap_list[i].cmd)
		rb_gc_mark(vm->trap_list[i].cmd);
	}
    }

    RUBY_MARK_LEAVE("vm");
}
开发者ID:qnighy,项目名称:ruby-1.9.2p0,代码行数:34,代码来源:vm.c


示例11: cont_mark

static void
cont_mark(void *ptr)
{
    RUBY_MARK_ENTER("cont");
    if (ptr) {
	rb_context_t *cont = ptr;
	rb_gc_mark(cont->value);

	rb_thread_mark(&cont->saved_thread);
	rb_gc_mark(cont->saved_thread.self);

	if (cont->vm_stack) {
#ifdef CAPTURE_JUST_VALID_VM_STACK
	    rb_gc_mark_locations(cont->vm_stack,
				 cont->vm_stack + cont->vm_stack_slen + cont->vm_stack_clen);
#else
	    rb_gc_mark_locations(cont->vm_stack,
				 cont->vm_stack, cont->saved_thread.stack_size);
#endif
	}

	if (cont->machine.stack) {
	    if (cont->type == CONTINUATION_CONTEXT) {
		/* cont */
		rb_gc_mark_locations(cont->machine.stack,
				     cont->machine.stack + cont->machine.stack_size);
            }
            else {
		/* fiber */
		rb_thread_t *th;
                rb_fiber_t *fib = (rb_fiber_t*)cont;
		GetThreadPtr(cont->saved_thread.self, th);
		if ((th->fiber != fib) && fib->status == RUNNING) {
		    rb_gc_mark_locations(cont->machine.stack,
					 cont->machine.stack + cont->machine.stack_size);
		}
	    }
	}
#ifdef __ia64
	if (cont->machine.register_stack) {
	    rb_gc_mark_locations(cont->machine.register_stack,
				 cont->machine.register_stack + cont->machine.register_stack_size);
	}
#endif
    }
    RUBY_MARK_LEAVE("cont");
}
开发者ID:rhenium,项目名称:ruby,代码行数:47,代码来源:cont.c


示例12: mark

static void
mark(struct png_data *reader)
{
    VALUE io = reader->io;

    if (io)
	rb_gc_mark(io);
}
开发者ID:ender672,项目名称:axon,代码行数:8,代码来源:png.c


示例13: cb_http_request_mark

void
cb_http_request_mark(void *ptr)
{
    struct cb_http_request_st *request = ptr;
    if (request) {
        rb_gc_mark(request->on_body_callback);
    }
}
开发者ID:funny-falcon,项目名称:couchbase-ruby-client,代码行数:8,代码来源:http.c


示例14: mark_root_object

/*
 * Mark root object. (protect from GC)
 */
void
mark_root_object(void *ptr)
{
  VALUE value;
  if (ptr && st_lookup(root_table, (st_data_t)ptr, (st_data_t*)&value)) {
    rb_gc_mark(value);
  }
}
开发者ID:JobV,项目名称:ruby-opencv,代码行数:11,代码来源:opencv.cpp


示例15: cb_timer_mark

    void
cb_timer_mark(void *ptr)
{
    struct timer_st *timer = ptr;
    if (timer) {
        rb_gc_mark(timer->callback);
    }
}
开发者ID:wr0ngway,项目名称:couchbase-ruby-client,代码行数:8,代码来源:timer.c


示例16: mark_event_hooks

static void
mark_event_hooks(rb_event_hook_t *hook)
{
    while (hook) {
	rb_gc_mark(hook->data);
	hook = hook->next;
    }
}
开发者ID:qnighy,项目名称:ruby-1.9.2p0,代码行数:8,代码来源:vm.c


示例17: location_mark

static void
location_mark(void *ptr)
{
    if (ptr) {
	struct valued_frame_info *vfi = (struct valued_frame_info *)ptr;
	rb_gc_mark(vfi->btobj);
    }
}
开发者ID:sho-h,项目名称:ruby,代码行数:8,代码来源:vm_backtrace.c


示例18: dlcfunc_mark

static void
dlcfunc_mark(void *ptr)
{
    struct cfunc_data *data = ptr;
    if (data->wrap) {
	rb_gc_mark(data->wrap);
    }
}
开发者ID:ArekX,项目名称:RAGE,代码行数:8,代码来源:cfunc.c


示例19: mark_list

static void
mark_list(List *list)
{
    Entry *entry;
    for (entry = list->entries; entry; entry = entry->next) {
        rb_gc_mark(entry->value);
    }
}
开发者ID:genki,项目名称:fastthread,代码行数:8,代码来源:fastthread.c


示例20: c_CompletionResult_mark

static void c_CompletionResult_mark(void *s)
{
    if (s)
    {
        CompletionResult_t *t = (CompletionResult_t *) s;
        rb_gc_mark(t->parent);
    }
}
开发者ID:cedlemo,项目名称:ruby-clangc,代码行数:8,代码来源:class_CompletionResult.c



注:本文中的rb_gc_mark函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rb_global_variable函数代码示例发布时间:2022-05-30
下一篇:
C++ rb_funcall2函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap