本文整理汇总了C++中GO函数的典型用法代码示例。如果您正苦于以下问题:C++ GO函数的具体用法?C++ GO怎么用?C++ GO使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GO函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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"));
}
示例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);
}
示例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);
}
示例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));
}
示例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(">"));
}
示例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);
}
示例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();
}
示例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);
}
示例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
}
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}