Permalink
Browse files

small struct_type representation change

  • Loading branch information...
JeffBezanson committed Aug 24, 2012
1 parent 675c85f commit a3cfc6954dae8eb755bae0f36003105cdde5d302
Showing with 4 additions and 4 deletions.
  1. +2 −1 src/alloc.c
  2. +2 −2 src/julia.h
  3. +0 −1 src/newobj_internal.h
View
@@ -506,7 +506,8 @@ jl_struct_type_t *jl_new_uninitialized_struct_type(size_t nfields)
{
return (jl_struct_type_t*)
newobj((jl_type_t*)jl_struct_kind,
- STRUCT_TYPE_NW + NWORDS(nfields*sizeof(jl_fielddesc_t)));
+ NWORDS(sizeof(jl_struct_type_t) - sizeof(void*) +
+ (nfields-1)*sizeof(jl_fielddesc_t)));
}
void jl_compute_struct_offsets(jl_struct_type_t *st)
View
@@ -231,7 +231,7 @@ typedef struct {
jl_value_t *ctor_factory;
jl_value_t *instance; // for singletons
// hidden fields:
- uptrint_t uid;
+ uint32_t uid;
uint32_t size;
uint32_t alignment; // strictest alignment over all fields
jl_fielddesc_t fields[1];
@@ -248,7 +248,7 @@ typedef struct {
jl_tuple_t *parameters;
int32_t nbits;
// hidden fields:
- uptrint_t uid;
+ uint32_t uid;
} jl_bits_type_t;
typedef struct {
View
@@ -16,7 +16,6 @@ static inline jl_value_t *newstruct(jl_struct_type_t *type)
}
#define TAG_TYPE_NW (NWORDS(sizeof(jl_tag_type_t))-1)
-#define STRUCT_TYPE_NW (NWORDS(sizeof(jl_struct_type_t))-1)
#define BITS_TYPE_NW (NWORDS(sizeof(jl_bits_type_t))-1)
int jl_assign_type_uid(void);

0 comments on commit a3cfc69

Please sign in to comment.