summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/application/index.md2
-rw-r--r--docs/application/namespace.md4
-rw-r--r--docs/application/native.md7
-rw-r--r--docs/application/pool.md2
-rw-r--r--docs/application/shared.md4
-rw-r--r--docs/application/testing.md4
-rw-r--r--docs/application/thread.md6
-rw-r--r--docs/application/type.md2
8 files changed, 19 insertions, 12 deletions
diff --git a/docs/application/index.md b/docs/application/index.md
index 115d8b2..f15f0a0 100644
--- a/docs/application/index.md
+++ b/docs/application/index.md
@@ -6,7 +6,7 @@
* Linux X64 with io_uring (6+)
* GNU Make
-* GCC with -std=gnu23 -fhardened (14+)
+* GCC with -std=gnu99 -fhardened (14+)
# Sections
diff --git a/docs/application/namespace.md b/docs/application/namespace.md
index 07af049..3dd6bfa 100644
--- a/docs/application/namespace.md
+++ b/docs/application/namespace.md
@@ -25,7 +25,7 @@ typedef struct _kpl_namespace_module {
kpl_buffer *module_name, *module_string;
kpl_export *exports;
kpl_task *task;
- atomic_int_least32_t children;
+ _Atomic int32_t children;
} kpl_namespace_module;
static kpl_namespace_module *namespace_module_head;
@@ -34,7 +34,7 @@ typedef struct _kpl_namespace_string {
kpl_buffer *string;
kpl_task *task;
kpl_type_ptr ast;
- atomic_int_least32_t children;
+ _Atomic int32_t children;
} kpl_namespace_string;
```
diff --git a/docs/application/native.md b/docs/application/native.md
index 71f1ffb..523de66 100644
--- a/docs/application/native.md
+++ b/docs/application/native.md
@@ -1,3 +1,10 @@
# Native
---
+
+```c
+typedef struct _kpl_native {
+ KPL_POOL_HEADER(_kpl_native);
+ kpl_class class;
+} kpl_native;
+```
diff --git a/docs/application/pool.md b/docs/application/pool.md
index 3795be0..3fc3e79 100644
--- a/docs/application/pool.md
+++ b/docs/application/pool.md
@@ -15,7 +15,7 @@ typedef void kpl_pool_on_fn(void *obj);
typedef strut {
uint32_t min_obj_size;
- atomic_size_t alloc_byte_size;
+ _Atomic size_t alloc_byte_size;
kpl_pool_obj *root;
kpl_pool_on_fn *on_init, *on_free;
pthread_mutex_t root_mutex;
diff --git a/docs/application/shared.md b/docs/application/shared.md
index cbb773e..c5d7e9e 100644
--- a/docs/application/shared.md
+++ b/docs/application/shared.md
@@ -7,14 +7,14 @@
```c
typedef struct _kpl_shared {
KPL_POOL_HEADER(_kpl_shared);
- atomic_flag mutating;
+ _Atomic bool mutating;
bool mark;
kpl_class class;
kpl_task *queue_head, queue_tail;
pthread_mutex_t queue_mutex;
} kpl_shared;
-static atomic_int_fast32_t shared_threads_marked;
+static _Atomic int32_t shared_threads_marked;
static kpl_shared *shared_pool_sweep, *shared_pool;
diff --git a/docs/application/testing.md b/docs/application/testing.md
index 5d7b277..6e85c6f 100644
--- a/docs/application/testing.md
+++ b/docs/application/testing.md
@@ -24,11 +24,11 @@ typedef struct {
// TODO STORE ERRORS FOR PRINT AT END
-#define _TEST_FN(NAME) static void kpl_test_fn_##NAME([[gnu::constructor]] kpl_test *_test)
+#define _TEST_FN(NAME) static void kpl_test_fn_##NAME(__attribute__(unused)) kpl_test *_test)
#define TEST(NAME) \
_TEST_FN(NAME); \
- [[gnu::constructor]] static void _kpl_test_constructor_##NAME(void) { \
+ static void __attribute__((constructor)) _kpl_test_constructor_##NAME(void) { \
kpl_test _test = { .name = #NAME; .error = nullptr }; \
kpl_test_fn_##NAME(&test); \
if (_test.error) { \
diff --git a/docs/application/thread.md b/docs/application/thread.md
index a6b77e6..ee2a317 100644
--- a/docs/application/thread.md
+++ b/docs/application/thread.md
@@ -11,7 +11,7 @@ typedef void kpl_task_fn(kpl_task *t);
typedef struct _kpl_task {
KPL_POOL_HEADER(_kpl_task);
- atomic_flag next_ready;
+ _Atomic bool next_ready;
uint16_t thread_id;
kpl_task_fn *fn;
kpl_group *state;
@@ -20,7 +20,7 @@ typedef struct _kpl_task {
} kpl_task;
typedef struct {
- atomic_flag gc_wait;
+ _Atomic bool gc_wait;
kpl_task *queue_head, *queue_tail;
pthread_t thread;
} kpl_thread;
@@ -29,7 +29,7 @@ typedef struct {
static int32_t available_threads; // find with sched_getaffinity
-static atomic_int_fast32_t running_threads; // init to available_threads
+static _Atomic int32_t running_threads; // init to available_threads
static kpl_task *async_queue_head, *async_queue_tail;
diff --git a/docs/application/type.md b/docs/application/type.md
index 5a856bd..5ca4469 100644
--- a/docs/application/type.md
+++ b/docs/application/type.md
@@ -34,7 +34,7 @@ typedef struct {
kpl_type_template template;
uint8_t qualifiers;
uint16_t modifiers;
- atomic_int_least32_t ref_count;
+ _Atomic int32_t ref_count;
kpl_ptr self;
kpl_type_body body;
} kpl_type;