You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
405 B

#pragma once
#include <stdatomic.h>
#include <stdint.h>
/* Count of the total number of requests we've ever allocated. Never decrements as it is used to generate IDs */
extern _Atomic uint64_t sandbox_total;
static inline void
sandbox_total_initialize()
{
atomic_init(&sandbox_total, 0);
}
static inline uint64_t
sandbox_total_postfix_increment()
{
return atomic_fetch_add(&sandbox_total, 1) + 1;
}