diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-10-07 14:31:25 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-07 14:31:25 +0300 |
| commit | b7a88ee2910a1c76ccbae38a9e7226d6c93fff37 (patch) | |
| tree | ee3a8e8d23443dd5ef8bc832cc3a29b2d594b8f0 /lib/vector.c | |
| parent | b1003f64b2c41ece17993c8e13b2810a6c55f1a1 (diff) | |
| parent | 72618ba82af966bbde6fda49905f6b2b6fa25fd0 (diff) | |
Merge pull request #9758 from idryzhov/resolver-thread
lib: fix incorrect thread management
Diffstat (limited to 'lib/vector.c')
| -rw-r--r-- | lib/vector.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/vector.c b/lib/vector.c index 565c49fd59..4af564a82f 100644 --- a/lib/vector.c +++ b/lib/vector.c @@ -123,6 +123,17 @@ int vector_set_index(vector v, unsigned int i, void *val) return i; } +/* Make a specified index slot active and return its address. */ +void **vector_get_index(vector v, unsigned int i) +{ + vector_ensure(v, i); + + if (v->active <= i) + v->active = i + 1; + + return &v->index[i]; +} + /* Look up vector. */ void *vector_lookup(vector v, unsigned int i) { |
