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

C++ GO函数代码示例

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

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



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

示例1: GO

  void PolyInlineCache::bootstrap(STATE) {
    GO(poly_inline_cache).set(state->memory()->new_class<Class, PolyInlineCache>(
          state, G(call_site), G(rubinius), "PolyInlineCache"));

    GO(inline_cache_entry).set(state->memory()->new_class<Class, InlineCacheEntry>(
          state, G(call_site), G(rubinius), "InlineCacheEntry"));
  }
开发者ID:Omosofe,项目名称:rubinius,代码行数:7,代码来源:poly_inline_cache.cpp


示例2: GO

  void CompiledMethod::init(STATE) {
    GO(cmethod).set(state->new_class("CompiledMethod", G(executable)));
    G(cmethod)->set_object_type(state, CompiledMethodType);

    GO(cmethod_vis).set(state->new_class("Visibility", G(object), G(cmethod)));
    G(cmethod_vis)->set_object_type(state, MethodVisibilityType);
  }
开发者ID:soaexpert,项目名称:rubinius,代码行数:7,代码来源:compiledmethod.cpp


示例3: onig_init

  void Regexp::init(STATE) {
    onig_init();
    GO(regexp).set(state->new_class("Regexp", G(object), 0));
    G(regexp)->set_object_type(state, RegexpType);

    GO(matchdata).set(state->new_class("MatchData", G(object), 0));
    G(matchdata)->set_object_type(state, MatchDataType);
  }
开发者ID:thiagopradi,项目名称:rubinius,代码行数:8,代码来源:regexp.cpp


示例4: GO

  void Selector::init(STATE) {
    GO(selectors).set(LookupTable::create(state));
    Class* cls = state->new_class("Selector", G(object), G(rubinius));
    cls->set_object_type(state, SelectorType);
    cls->name(state, state->symbol("Rubinius::Selector"));

    GO(selector).set(cls);

    cls->set_const(state, state->symbol("ALL"), G(selectors));
  }
开发者ID:dbalatero,项目名称:rubinius,代码行数:10,代码来源:selector.cpp


示例5: add_sym

  void VM::bootstrap_symbol() {
#define add_sym(name) GO(sym_ ## name).set(symbol(#name))
    add_sym(object_id);
    add_sym(method_missing);
    add_sym(inherited);
    add_sym(from_literal);
    add_sym(method_added);
    add_sym(send);
    add_sym(public);
    add_sym(private);
    add_sym(protected);
    add_sym(undef);
    add_sym(const_missing);
    add_sym(object_id);
    add_sym(call);
    add_sym(coerce_into_array);
#undef add_sym
    GO(sym_s_method_added).set(symbol("singleton_method_added"));
    GO(sym_init_copy).set(symbol("initialize_copy"));
    GO(sym_plus).set(symbol("+"));
    GO(sym_minus).set(symbol("-"));
    GO(sym_equal).set(symbol("=="));
    GO(sym_nequal).set(symbol("!="));
    GO(sym_tequal).set(symbol("==="));
    GO(sym_lt).set(symbol("<"));
    GO(sym_gt).set(symbol(">"));
  }
开发者ID:atoulme,项目名称:rubinius,代码行数:27,代码来源:ontology.cpp


示例6: G

  /* Register the List and List::Node classes as globals */
  void List::init(STATE) {
    Class* cls;
    cls = ontology::new_class_under(state, "List", G(rubinius));

    GO(list).set(cls);
    cls->set_object_type(state, ListType);

    GO(list_node).set(ontology::new_class_under(state,
          "Node", cls));

    G(list_node)->set_object_type(state, ListNodeType);
  }
开发者ID:DanielVartanov,项目名称:rubinius,代码行数:13,代码来源:list.cpp


示例7: bootstrap_class

  /* Creates the rubinius object universe from scratch. */
  void VM::bootstrap_ontology() {

    /*
     * Bootstrap everything so we can create fully initialized
     * Classes.
     */
    bootstrap_class();

    /*
     * Everything is now setup for us to make fully initialized
     * classes.
     */

    /*
     * Create our Rubinius module that we hang stuff off
     */

    initialize_fundamental_constants();

    bootstrap_symbol();
    initialize_builtin_classes();
    bootstrap_exceptions();

    /*
     * Create any 'stock' objects
     */

    Object* main = new_object<Object>(G(object));
    GO(main).set(main);
    G(object)->set_const(this, "MAIN", main); // HACK test hooking up MAIN

    Object* undef = new_object<Object>(G(object));
    GO(undefined).set(undef);

    GO(vm).set(new_class_under("VM", G(rubinius)));
    G(vm)->name(state, state->symbol("Rubinius::VM"));

    Module* type = new_module("Type", G(rubinius));
    type->name(state, state->symbol("Rubinius::Type"));

    System::bootstrap_methods(this);
    Module::bootstrap_methods(this);
    StaticScope::bootstrap_methods(this);
    VariableScope::bootstrap_methods(this);

    /*
     * Setup the table we use to store ivars for immediates
     */

    GO(external_ivars).set(LookupTable::create(this));

    initialize_platform_data();
  }
开发者ID:AndreMeira,项目名称:rubinius,代码行数:54,代码来源:ontology.cpp


示例8: G

  /* Register the List and List::Node classes as globals */
  void List::init(STATE) {
    Class* cls;
    cls = state->new_class_under("List", G(rubinius));

    GO(list).set(cls);
    cls->set_object_type(state, ListType);
    G(list)->name(state, state->symbol("Rubinius::List"));

    GO(list_node).set(state->new_class("Node", G(object), cls));

    G(list_node)->set_object_type(state, ListNodeType);
  }
开发者ID:AndrewVos,项目名称:rubinius,代码行数:13,代码来源:list.cpp


示例9: fill

static void fill(int x, int y, int c)
{
	int stp;
	char m;

	stp = 0;
	st[stp++] = x;
	st[stp++] = y;
	m = map[y][x];
	assign[y][x] = c;

	while (stp >= 2) {
		y = st[--stp];
		x = st[--stp];

#define GO(Y,X) if (map[Y][X] == m && assign[Y][X] == 0) \
		      { assign[Y][X] = c; st[stp++] = (X); st[stp++] = (Y); }

		if (y > 0) {
			if (x > 0) GO(y - 1, x - 1);
			GO(y - 1, x);
			if ((x + 1) < width) GO(y - 1, x + 1);
		}

		if (x > 0) GO(y, x - 1);
		if ((x + 1) < width) GO(y, x + 1);

		if ((y + 1) < height) {
			if (x > 0) GO(y + 1, x - 1);
			GO(y + 1, x);
			if ((x + 1) < width) GO(y + 1, x + 1);
		}
#undef GO
	}
}
开发者ID:DavidToca,项目名称:acm,代码行数:35,代码来源:776.c


示例10: GO

  void CallSite::bootstrap(STATE) {
    GO(call_site).set(state->memory()->new_class<Class, CallSite>(
          state, G(rubinius), "CallSite"));

    max_caches = state->shared().config.machine_call_site_cache_limit.value;
    max_evictions = state->shared().config.machine_call_site_eviction_limit.value;
  }
开发者ID:rubinius,项目名称:rubinius,代码行数:7,代码来源:call_site.cpp


示例11: GO

  void NativeMethod::init(STATE) {
    GO(nmethod).set(ontology::new_class(state, "NativeMethod",
          G(executable), G(rubinius)));
    G(nmethod)->set_object_type(state, NativeMethodType);

    init_thread(state);
  }
开发者ID:monkeylibre,项目名称:rubinius,代码行数:7,代码来源:nativemethod.cpp


示例12: get

			bool get(uint64_t i) const
			{
				assert ( i < n );

				uint64_t const block = i / blocksize;
				i -= block*blocksize;

				uint64_t const blockptr = getBlockPointer(block);
				uint64_t const wordoff = (blockptr / (8*sizeof(uint64_t)));
				uint64_t const bitoff = blockptr % (8*sizeof(uint64_t));

				::libmaus2::util::GetObject<uint64_t const *> GO(data.begin() + wordoff);
				::libmaus2::gamma::GammaDecoder < ::libmaus2::util::GetObject<uint64_t const *> > GD(GO);
				if ( bitoff )
					GD.decodeWord(bitoff);

				GD.decodeWord(rankaccbits); // 1 bit accumulator
				bool sym = GD.decodeWord(1);

				uint64_t rl = GD.decode()+1;

				while ( i >= rl )
				{
					i -= rl;
					sym = ! sym;
					rl = GD.decode()+1;
				}

				return sym;
			}
开发者ID:gt1,项目名称:libmaus2,代码行数:30,代码来源:RunLengthBitVector.hpp


示例13: compare

 static bool compare(CommPtr comm, Read<Real> a, Read<Real> b, Real tol,
     Real floor, Int ncomps, Int dim) {
   if (comm->reduce_and(are_close(a, b, tol, floor))) return true;
   /* if floating point arrays are different, we find the value with the
      largest relative difference and print it out for users to determine
      whether this is actually a serious regression
      (and where in the mesh it is most serious)
      or whether tolerances simply need adjusting */
   auto ah = HostRead<Real>(a);
   auto bh = HostRead<Real>(b);
   LO max_i = -1;
   Real max_diff = 0.0;
   for (LO i = 0; i < ah.size(); ++i) {
     auto diff = rel_diff_with_floor(ah[i], bh[i], floor);
     if (diff > max_diff) {
       max_i = i;
       max_diff = diff;
     }
   }
   auto global_start = comm->exscan(GO(ah.size()), OMEGA_H_SUM);
   auto global_max_diff = comm->allreduce(max_diff, OMEGA_H_MAX);
   I32 rank_cand = ArithTraits<I32>::max();
   if (max_diff == global_max_diff) rank_cand = comm->rank();
   auto best_rank = comm->allreduce(rank_cand, OMEGA_H_MIN);
   if (comm->rank() == best_rank) {
     auto global_max_i = global_start + max_i;
     auto ent_global = global_max_i / ncomps;
     auto comp = global_max_i % ncomps;
     std::cout << "max diff at " << singular_names[dim] << " " << ent_global
               << ", comp " << comp << ", values " << ah[max_i] << " vs "
               << bh[max_i] << '\n';
   }
   comm->barrier();
   return false;
 }
开发者ID:ibaned,项目名称:omega_h,代码行数:35,代码来源:compare.cpp


示例14: sys_zone2

static void sys_zone2(void)
{
   uint_t numzones = x0 + 1;

   GO(SYS_zone, "(ZONE_LIST_DEFUNCT) 2s 1m");
   SY(SYS_zone, x0 + ZONE_LIST_DEFUNCT, x0 + 1, &numzones); SUCC;
}
开发者ID:AboorvaDevarajan,项目名称:Valgrind-tool,代码行数:7,代码来源:scalar_zone_defunct.c


示例15: GCS

bool Graph_Completer::sort_everything()
{
    Graph_Cyclic_Sorter<Point> GCS(G_);
    unsigned int i=1, N = G_->nb_vertices();
    while (i<N && GCS.neighbors_cyclic_sort(i))
    {
        i++;
    }

    G_->extract_abstract_graph(*output_abstract_graph_);
    G_->remove_vertex_by_index(0);

    Graph_Orienter<Point> GO(G_);
    for (i=0; i<G_->nb_vertices(); i++)
    {
        if (!GO.are_neighbors_correctly_oriented(i))
        {
            G_->reverse_neighbors_by_index(i);
            output_abstract_graph_->reverse_neighbors_by_index(i+1);
        }
    }

    *output_angle_ = G_->direction_from_center_of_mass(0);

    return (i==N);
}
开发者ID:seub,项目名称:CirclePackings,代码行数:26,代码来源:graph_completer.cpp


示例16: GO

  void AtomicReference::init(STATE) {
    GO(atomic_ref).set(ontology::new_class(state,
          "AtomicReference", G(object), G(rubinius)));

    G(atomic_ref)->set_object_type(state, AtomicReferenceType);
    G(atomic_ref)->name(state, state->symbol("Rubinius::AtomicReference"));
  }
开发者ID:Gimi,项目名称:rubinius,代码行数:7,代码来源:atomic.cpp


示例17: GO

  void BlockEnvironment::init(STATE) {
    GO(blokenv).set(ontology::new_class(state, "BlockEnvironment", G(object),
                                     G(rubinius)));
    G(blokenv)->set_object_type(state, BlockEnvironmentType);


  }
开发者ID:Locke23rus,项目名称:rubinius,代码行数:7,代码来源:block_environment.cpp


示例18: GO

void Numeric::init(STATE) {
    GO(numeric).set(ontology::new_class(state, "Numeric"));
    // We inherit from this type in for example Rational
    // and that class shouldn't have NumericType set since
    // that can cause problems.
    G(numeric)->set_object_type(state, ObjectType);
}
开发者ID:cypher,项目名称:rubinius,代码行数:7,代码来源:integer.cpp


示例19: G

 void BlockWrapper::init(STATE) {
   Class* cls = state->new_class("Proc", G(object));
   GO(block_wrapper).set(
       state->new_class("FromBlock", cls, cls));
   G(block_wrapper)->set_object_type(state, BlockEnvironmentType);
   G(block_wrapper)->name(state, state->symbol("Proc::FromBlock"));
 }
开发者ID:soaexpert,项目名称:rubinius,代码行数:7,代码来源:block_wrapper.cpp


示例20: main

int main(void)
{
   int res;
   
   GO(__NR_fork, 2, "0e");
   SY(__NR_fork);

   return(0);
}
开发者ID:520SRig,项目名称:valgrind,代码行数:9,代码来源:scalar_fork.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GOBJ2RVAL函数代码示例发布时间:2022-05-30
下一篇:
C++ GNUNET_strdup函数代码示例发布时间: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