-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathobject-heap.h
More file actions
33 lines (28 loc) · 860 Bytes
/
object-heap.h
File metadata and controls
33 lines (28 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once
#include <string.h>
#include "classfile.h"
#include "list.h"
typedef struct object {
variable_t *value;
class_file_t *class;
size_t fields_count;
struct object *parent;
} object_t;
typedef struct {
u2 length;
object_t **objects;
} object_heap_t;
void init_object_heap();
void free_object_heap();
object_t *create_object(class_file_t *clazz);
char *create_string(class_file_t *clazz, char *src);
void **build_array(uint8_t depth,
int dimension,
int *n_elements,
size_t type_size);
void free_array(object_t *obj, uint8_t depth, int dimension, void **arr);
void *create_array(class_file_t *clazz,
uint8_t dimension,
int *dimensions,
size_t type_size);
variable_t *find_field_addr(object_t *obj, char *name);