blob: 6483a5f8d11afb13b989c208628708ee8853ef83 (
plain)
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
|
// Object stacks, used in lieu of dynamically-sized frames.
#ifndef RUST_OBSTACK_H
#define RUST_OBSTACK_H
struct rust_obstack_chunk;
struct rust_task;
struct type_desc;
class rust_obstack {
rust_obstack_chunk *chunk;
rust_task *task;
// Allocates the given number of bytes in a new chunk.
void *alloc_new(size_t len, type_desc *tydesc);
public:
rust_obstack(rust_task *in_task) : chunk(NULL), task(in_task) {}
~rust_obstack();
void *alloc(size_t len, type_desc *tydesc);
void free(void *ptr);
void *mark();
};
#endif
|