-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
arraylist.h
49 lines (35 loc) · 1.32 KB
/
arraylist.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// This file is a part of Julia. License is MIT: https://julialang.org/license
#ifndef JL_ARRAYLIST_H
#define JL_ARRAYLIST_H
#define AL_N_INLINE 29
#define SMALL_AL_N_INLINE 6
#ifdef __cplusplus
extern "C" {
#endif
#include "analyzer_annotations.h"
typedef struct {
size_t len;
size_t max;
void **items;
void *_space[AL_N_INLINE];
} arraylist_t;
JL_DLLEXPORT arraylist_t *arraylist_new(arraylist_t *a, size_t size) JL_NOTSAFEPOINT;
JL_DLLEXPORT void arraylist_free(arraylist_t *a) JL_NOTSAFEPOINT;
JL_DLLEXPORT void arraylist_push(arraylist_t *a, void *elt) JL_NOTSAFEPOINT;
JL_DLLEXPORT void *arraylist_pop(arraylist_t *a) JL_NOTSAFEPOINT;
JL_DLLEXPORT void arraylist_grow(arraylist_t *a, size_t n) JL_NOTSAFEPOINT;
typedef struct {
uint32_t len;
uint32_t max;
void **items;
void *_space[SMALL_AL_N_INLINE];
} small_arraylist_t;
JL_DLLEXPORT small_arraylist_t *small_arraylist_new(small_arraylist_t *a, uint32_t size) JL_NOTSAFEPOINT;
JL_DLLEXPORT void small_arraylist_free(small_arraylist_t *a) JL_NOTSAFEPOINT;
JL_DLLEXPORT void small_arraylist_push(small_arraylist_t *a, void *elt) JL_NOTSAFEPOINT;
JL_DLLEXPORT void *small_arraylist_pop(small_arraylist_t *a) JL_NOTSAFEPOINT;
JL_DLLEXPORT void small_arraylist_grow(small_arraylist_t *a, uint32_t n) JL_NOTSAFEPOINT;
#ifdef __cplusplus
}
#endif
#endif