started: Adding read_only access qualifier to params of internal X-TU function protos.

Will expand to all internal protos, and then will expand to user-facing API protos (mostly relevant for C API.)

Fortune for rngxx's current commit: Blessing − 吉
master
Avril 3 years ago
parent 8eb88a65b4
commit bd22305f77
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -16,8 +16,10 @@
extern "C" { extern "C" {
#endif #endif
#define _ro_p(n) __attribute__((access (read_only, n)))
rng_t* RNG_IMPL(mkdriver)(enum rng_kind kind, const u64* restrict seed) _export(internal); rng_t* RNG_IMPL(mkdriver)(enum rng_kind kind, const u64* restrict seed) _export(internal);
int RNG_IMPL(mnext)(rng_t* engine, void* restrict output, const struct rng_next_opt* restrict opt) _export(internal); int RNG_IMPL(mnext)(rng_t* engine, void* restrict output, const struct rng_next_opt* restrict opt) _ro_p(3) _export(internal);
int RNG_IMPL(m_allocsz_for)(enum rng_next_type ty, size_t* restrict size, size_t* restrict align) _export(internal); int RNG_IMPL(m_allocsz_for)(enum rng_next_type ty, size_t* restrict size, size_t* restrict align) _export(internal);
@ -25,6 +27,8 @@ rng_t* RNG_IMPL(dynctor_trycall)(const char* name, const void* seed) _export(int
struct rng_dyn_ctor* RNG_IMPL(dynctor_refer)(const char* name) _export(internal); struct rng_dyn_ctor* RNG_IMPL(dynctor_refer)(const char* name) _export(internal);
rng_t* RNG_IMPL(dynctor_callref)(struct rng_dyn_ctor* ptr, const void* seed) _export(internal); rng_t* RNG_IMPL(dynctor_callref)(struct rng_dyn_ctor* ptr, const void* seed) _export(internal);
#undef _ro_p
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

Loading…
Cancel
Save