本文整理汇总了C++中MVM_gc_allocate_type_object函数的典型用法代码示例。如果您正苦于以下问题:C++ MVM_gc_allocate_type_object函数的具体用法?C++ MVM_gc_allocate_type_object怎么用?C++ MVM_gc_allocate_type_object使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MVM_gc_allocate_type_object函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: type_object_for
/* Creates a new type object of this representation, and associates it with
* the given HOW. */
static MVMObject * type_object_for(MVMThreadContext *tc, MVMObject *HOW) {
MVMSTable *st = MVM_gc_allocate_stable(tc, this_repr, HOW);
MVMObject *obj = MVM_gc_allocate_type_object(tc, st);
MVM_ASSIGN_REF(tc, st, st->WHAT, obj);
st->size = sizeof(P6num);
return st->WHAT;
}
示例2: type_object_for
/* Creates a new type object of this representation, and associates it with
* the given HOW. */
static MVMObject * type_object_for(MVMThreadContext *tc, MVMObject *HOW) {
MVMSTable *st = MVM_gc_allocate_stable(tc, &this_repr, HOW);
MVMROOT(tc, st, {
MVMObject *obj = MVM_gc_allocate_type_object(tc, st);
MVM_ASSIGN_REF(tc, &(st->header), st->WHAT, obj);
st->size = sizeof(MVMUninstantiable);
});
示例3: type_object_for
/* Creates a new type object of this representation, and associates it with
* the given HOW. */
static MVMObject * type_object_for(MVMThreadContext *tc, MVMObject *HOW) {
MVMSTable *st = MVM_gc_allocate_stable(tc, &this_repr, HOW);
MVMROOT(tc, st, {
MVMObject *obj = MVM_gc_allocate_type_object(tc, st);
MVM_ASSIGN_REF(tc, st, st->WHAT, obj);
st->size = sizeof(MVMKnowHOWAttributeREPR);
});
示例4: type_object_for
/* Creates a new type object of this representation, and associates it with
* the given HOW. Also sets the invocation protocol handler in the STable. */
static MVMObject * type_object_for(MVMThreadContext *tc, MVMObject *HOW) {
MVMSTable *st = MVM_gc_allocate_stable(tc, &this_repr, HOW);
MVMROOT(tc, st, {
MVMObject *obj = MVM_gc_allocate_type_object(tc, st);
MVM_ASSIGN_REF(tc, st, st->WHAT, obj);
st->invoke = invoke_handler;
st->size = sizeof(MVMStaticFrame);
});
示例5: type_object_for
/* Creates a new type object of this representation, and associates it with
* the given HOW. Also sets the invocation protocol handler in the STable. */
static MVMObject * type_object_for(MVMThreadContext *tc, MVMObject *HOW) {
MVMSTable *st;
MVMObject *obj;
st = MVM_gc_allocate_stable(tc, this_repr, HOW);
MVMROOT(tc, st, {
obj = MVM_gc_allocate_type_object(tc, st);
MVM_ASSIGN_REF(tc, st, st->WHAT, obj);
st->size = sizeof(MVMException);
});
示例6: type_object_for
/* Creates a new type object of this representation, and associates it with
* the given HOW. */
static MVMObject * type_object_for(MVMThreadContext *tc, MVMObject *HOW) {
MVMSTable *st = MVM_gc_allocate_stable(tc, &this_repr, HOW);
MVMROOT(tc, st, {
MVMObject *obj = MVM_gc_allocate_type_object(tc, st);
MVMP6numREPRData *repr_data = (MVMP6numREPRData *)MVM_malloc(sizeof(MVMP6numREPRData));
repr_data->bits = sizeof(MVMnum64) * 8;
mk_storage_spec(tc, repr_data->bits, &repr_data->storage_spec);
MVM_ASSIGN_REF(tc, &(st->header), st->WHAT, obj);
st->size = sizeof(MVMP6num);
st->REPR_data = repr_data;
});
示例7: type_object_for
/* Creates a new type object of this representation, and associates it with
* the given HOW. */
static MVMObject * type_object_for(MVMThreadContext *tc, MVMObject *HOW) {
MVMSTable *st = MVM_gc_allocate_stable(tc, &this_repr, HOW);
MVMROOT(tc, st, {
MVMObject *obj = MVM_gc_allocate_type_object(tc, st);
MVMArrayREPRData *repr_data = (MVMArrayREPRData *)malloc(sizeof(MVMArrayREPRData));
repr_data->slot_type = MVM_ARRAY_OBJ;
repr_data->elem_size = sizeof(MVMObject *);
MVM_ASSIGN_REF(tc, st, st->WHAT, obj);
st->size = sizeof(MVMArray);
st->REPR_data = repr_data;
});
示例8: type_object_for
/* Creates a new type object of this representation, and associates it with
* the given HOW. */
static MVMObject * type_object_for(MVMThreadContext *tc, MVMObject *HOW) {
MVMSTable *st = MVM_gc_allocate_stable(tc, &this_repr, HOW);
MVMROOT(tc, st, {
MVMObject *obj = MVM_gc_allocate_type_object(tc, st);
MVMP6intREPRData *repr_data = (MVMP6intREPRData *)malloc(sizeof(MVMP6intREPRData));
repr_data->bits = sizeof(MVMint64) * 8;
repr_data->is_unsigned = 0;
MVM_ASSIGN_REF(tc, st, st->WHAT, obj);
st->size = sizeof(MVMP6int);
st->REPR_data = repr_data;
});
示例9: create_stub_VMString
/* Creates a stub VMString. Note we didn't initialize the
* representation yet, so have to do this somewhat pokily. */
static void create_stub_VMString(MVMThreadContext *tc) {
/* Need to create the REPR function table "in advance"; the
* MVMString REPR specially knows not to duplicately create
* this. */
MVMREPROps *repr = MVMString_initialize(tc);
/* Now we can create a type object; note we have no HOW yet,
* though. */
MVMSTable *st = MVM_gc_allocate_stable(tc, repr, NULL);
/* REPR normally sets up size, but we'll have to do that manually
* here also. */
st->size = sizeof(MVMString);
/* We can now go for the type object. */
tc->instance->VMString = MVM_gc_allocate_type_object(tc, st);
/* Set the WHAT in the STable we just made to point to the type
* object (this is completely normal). */
st->WHAT = tc->instance->VMString;
}