Fix alignment: part 2
This commit is contained in:
@@ -45,7 +45,6 @@ typedef struct \
|
|||||||
uint8_t size; \
|
uint8_t size; \
|
||||||
uint8_t max_lens; \
|
uint8_t max_lens; \
|
||||||
} \
|
} \
|
||||||
__packed \
|
|
||||||
NAME##_hash_table;
|
NAME##_hash_table;
|
||||||
|
|
||||||
#define HASH_INIT(NAME, SIZE) \
|
#define HASH_INIT(NAME, SIZE) \
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ linked_list_init (size_t element_size)
|
|||||||
{
|
{
|
||||||
size_t size = mem_heap_recommend_allocation_size (element_size);
|
size_t size = mem_heap_recommend_allocation_size (element_size);
|
||||||
linked_list list = mem_heap_alloc_block (size, MEM_HEAP_ALLOC_SHORT_TERM);
|
linked_list list = mem_heap_alloc_block (size, MEM_HEAP_ALLOC_SHORT_TERM);
|
||||||
if (list == NULL)
|
if (list == null_list)
|
||||||
{
|
{
|
||||||
__printf ("Out of memory");
|
__printf ("Out of memory");
|
||||||
JERRY_UNREACHABLE ();
|
JERRY_UNREACHABLE ();
|
||||||
@@ -39,7 +39,7 @@ linked_list_init (size_t element_size)
|
|||||||
__memset (list, 0, size);
|
__memset (list, 0, size);
|
||||||
linked_list_header* header = (linked_list_header *) list;
|
linked_list_header* header = (linked_list_header *) list;
|
||||||
header->magic = LINKED_LIST_MAGIC;
|
header->magic = LINKED_LIST_MAGIC;
|
||||||
header->prev = header->next = NULL;
|
header->prev = header->next = null_list;
|
||||||
header->block_size = (uint8_t) (size - sizeof (linked_list_header));
|
header->block_size = (uint8_t) (size - sizeof (linked_list_header));
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ linked_list_element (linked_list list, size_t element_size, size_t element_num)
|
|||||||
ASSERT_LIST (list);
|
ASSERT_LIST (list);
|
||||||
linked_list_header *header = (linked_list_header *) list;
|
linked_list_header *header = (linked_list_header *) list;
|
||||||
linked_list raw = list + sizeof (linked_list_header);
|
linked_list raw = list + sizeof (linked_list_header);
|
||||||
if (header->block_size <= element_size * (element_num + 1))
|
if (header->block_size < element_size * (element_num + 1))
|
||||||
{
|
{
|
||||||
if (header->next)
|
if (header->next)
|
||||||
{
|
{
|
||||||
@@ -84,9 +84,9 @@ linked_list_set_element (linked_list list, size_t element_size, size_t element_n
|
|||||||
ASSERT_LIST (list);
|
ASSERT_LIST (list);
|
||||||
linked_list_header *header = (linked_list_header *) list;
|
linked_list_header *header = (linked_list_header *) list;
|
||||||
linked_list raw = list + sizeof (linked_list_header);
|
linked_list raw = list + sizeof (linked_list_header);
|
||||||
if (header->block_size <= element_size * (element_num + 1))
|
if (header->block_size < element_size * (element_num + 1))
|
||||||
{
|
{
|
||||||
if (header->next == NULL)
|
if (header->next == null_list)
|
||||||
{
|
{
|
||||||
header->next = (linked_list_header *) linked_list_init (element_size);
|
header->next = (linked_list_header *) linked_list_init (element_size);
|
||||||
header->next->prev = header;
|
header->next->prev = header;
|
||||||
@@ -122,11 +122,13 @@ linked_list_set_element (linked_list list, size_t element_size, size_t element_n
|
|||||||
((uint64_t *) raw)[element_num] = *((uint64_t *) element);
|
((uint64_t *) raw)[element_num] = *((uint64_t *) element);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#ifdef __TARGET_HOST_x64
|
||||||
case sizeof (lp_string):
|
case sizeof (lp_string):
|
||||||
{
|
{
|
||||||
((lp_string *) raw)[element_num] = *((lp_string *) element);
|
((lp_string *) raw)[element_num] = *((lp_string *) element);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
__printf ("Element_size %d is not supported\n", element_size);
|
__printf ("Element_size %d is not supported\n", element_size);
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ typedef struct linked_list_header
|
|||||||
struct linked_list_header *prev;
|
struct linked_list_header *prev;
|
||||||
uint8_t magic;
|
uint8_t magic;
|
||||||
uint8_t block_size;
|
uint8_t block_size;
|
||||||
uint8_t used_size;
|
|
||||||
}
|
}
|
||||||
__packed
|
|
||||||
linked_list_header;
|
linked_list_header;
|
||||||
|
|
||||||
typedef uint8_t* linked_list;
|
typedef uint8_t* linked_list;
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ typedef struct
|
|||||||
ecma_char_t *str;
|
ecma_char_t *str;
|
||||||
ecma_length_t length;
|
ecma_length_t length;
|
||||||
}
|
}
|
||||||
__packed
|
|
||||||
lp_string;
|
lp_string;
|
||||||
|
|
||||||
bool lp_string_equal (lp_string, lp_string);
|
bool lp_string_equal (lp_string, lp_string);
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ typedef struct \
|
|||||||
DATA_TYPE current; \
|
DATA_TYPE current; \
|
||||||
DATA_TYPE block_len; \
|
DATA_TYPE block_len; \
|
||||||
} \
|
} \
|
||||||
__packed \
|
|
||||||
NAME##_stack;
|
NAME##_stack;
|
||||||
|
|
||||||
#define STACK_INIT(NAME) \
|
#define STACK_INIT(NAME) \
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ typedef struct tree_header
|
|||||||
linked_list children;
|
linked_list children;
|
||||||
uint8_t magic;
|
uint8_t magic;
|
||||||
uint8_t children_num;
|
uint8_t children_num;
|
||||||
uint16_t reserved;
|
|
||||||
}
|
}
|
||||||
__packed
|
|
||||||
tree_header;
|
tree_header;
|
||||||
|
|
||||||
#endif /* TREE_H */
|
#endif /* TREE_H */
|
||||||
|
|||||||
@@ -143,7 +143,6 @@ typedef struct
|
|||||||
token_type type;
|
token_type type;
|
||||||
uint8_t uid;
|
uint8_t uid;
|
||||||
}
|
}
|
||||||
__packed
|
|
||||||
token;
|
token;
|
||||||
|
|
||||||
void lexer_init (const char *, size_t, bool);
|
void lexer_init (const char *, size_t, bool);
|
||||||
|
|||||||
@@ -40,12 +40,12 @@ rewritable_opcode_type;
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint8_t args_count;
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
void (*fun1) (idx_t);
|
void (*fun1) (idx_t);
|
||||||
}
|
}
|
||||||
funs;
|
funs;
|
||||||
|
uint8_t args_count;
|
||||||
}
|
}
|
||||||
intrinsic_dumper;
|
intrinsic_dumper;
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,11 @@
|
|||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
linked_list opcodes;
|
|
||||||
tree_header t;
|
tree_header t;
|
||||||
|
linked_list opcodes;
|
||||||
opcode_counter_t opcodes_num;
|
opcode_counter_t opcodes_num;
|
||||||
unsigned strict_mode:1;
|
unsigned strict_mode:1;
|
||||||
}
|
}
|
||||||
__packed
|
|
||||||
scopes_tree_int;
|
scopes_tree_int;
|
||||||
|
|
||||||
typedef scopes_tree_int * scopes_tree;
|
typedef scopes_tree_int * scopes_tree;
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ struct
|
|||||||
uint8_t nums_count;
|
uint8_t nums_count;
|
||||||
opcode_counter_t opcodes_count;
|
opcode_counter_t opcodes_count;
|
||||||
}
|
}
|
||||||
__packed
|
|
||||||
bytecode_data;
|
bytecode_data;
|
||||||
|
|
||||||
scopes_tree current_scope;
|
scopes_tree current_scope;
|
||||||
|
|||||||
Reference in New Issue
Block a user