Skip to content

Commit

Permalink
Merge pull request #12076 from JuliaLang/sjk/ninitialized
Browse files Browse the repository at this point in the history
Expose ninitialized to Julia
  • Loading branch information
simonster committed Jul 15, 2015
2 parents 34cea83 + 624f239 commit 0eae746
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3117,7 +3117,7 @@ extern void jl_init_int32_int64_cache(void);
void jl_init_types(void)
{
// create base objects
jl_datatype_type = jl_new_uninitialized_datatype(9);
jl_datatype_type = jl_new_uninitialized_datatype(10);
jl_set_typeof(jl_datatype_type, jl_datatype_type);
jl_typename_type = jl_new_uninitialized_datatype(7);
jl_sym_type = jl_new_uninitialized_datatype(0);
Expand All @@ -3136,20 +3136,21 @@ void jl_init_types(void)
jl_datatype_type->name->primary = (jl_value_t*)jl_datatype_type;
jl_datatype_type->super = jl_type_type;
jl_datatype_type->parameters = jl_emptysvec;
jl_datatype_type->name->names = jl_svec(9, jl_symbol("name"),
jl_datatype_type->name->names = jl_svec(10, jl_symbol("name"),
jl_symbol("super"),
jl_symbol("parameters"),
jl_symbol("types"),
jl_symbol("instance"),
jl_symbol("size"),
jl_symbol("abstract"),
jl_symbol("mutable"),
jl_symbol("pointerfree"));
jl_datatype_type->types = jl_svec(9, jl_typename_type, jl_type_type,
jl_symbol("pointerfree"),
jl_symbol("ninitialized"));
jl_datatype_type->types = jl_svec(10, jl_typename_type, jl_type_type,
jl_simplevector_type, jl_simplevector_type,
jl_any_type,
jl_any_type, // size
jl_any_type, jl_any_type, jl_any_type);
jl_any_type, jl_any_type, jl_any_type, jl_any_type);
jl_datatype_type->instance = NULL;
jl_datatype_type->uid = jl_assign_type_uid();
jl_datatype_type->struct_decl = NULL;
Expand Down Expand Up @@ -3463,6 +3464,7 @@ void jl_init_types(void)
jl_svecset(jl_datatype_type->types, 6, (jl_value_t*)jl_bool_type);
jl_svecset(jl_datatype_type->types, 7, (jl_value_t*)jl_bool_type);
jl_svecset(jl_datatype_type->types, 8, (jl_value_t*)jl_bool_type);
jl_svecset(jl_datatype_type->types, 9, jl_int32_type);
jl_svecset(jl_function_type->types, 0, pointer_void);
jl_svecset(jl_tvar_type->types, 3, (jl_value_t*)jl_bool_type);
jl_svecset(jl_simplevector_type->types, 0, jl_long_type);
Expand Down
2 changes: 1 addition & 1 deletion src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ typedef struct _jl_datatype_t {
uint8_t abstract;
uint8_t mutabl;
uint8_t pointerfree;
int32_t ninitialized;
// hidden fields:
uint32_t nfields;
int32_t ninitialized;
uint32_t alignment : 31; // strictest alignment over all fields
uint32_t haspadding : 1; // has internal undefined bytes
uint32_t uid;
Expand Down

0 comments on commit 0eae746

Please sign in to comment.