diff --git a/.vs/CMake Overview b/.vs/CMake Overview deleted file mode 100644 index e69de29..0000000 diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json deleted file mode 100644 index 8f0d733..0000000 --- a/.vs/ProjectSettings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "CurrentProjectSetting": "x64-Debug" -} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json deleted file mode 100644 index c141193..0000000 --- a/.vs/VSWorkspaceState.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "OutputFoldersPerTargetSystem": { - "Local Machine": [ - "out\\build\\x64-Debug", - "out\\install\\x64-Debug" - ] - }, - "ExpandedNodes": [ - "", - "\\includes", - "\\src" - ], - "SelectedNode": "\\src\\FXAlloc.c", - "PreviewInSolutionExplorer": false -} \ No newline at end of file diff --git a/.vs/fxalloc.slnx/FileContentIndex/a2e3e4bc-8599-4af9-a20e-df25e9747ced.vsidx b/.vs/fxalloc.slnx/FileContentIndex/a2e3e4bc-8599-4af9-a20e-df25e9747ced.vsidx deleted file mode 100644 index 9d3eb68..0000000 Binary files a/.vs/fxalloc.slnx/FileContentIndex/a2e3e4bc-8599-4af9-a20e-df25e9747ced.vsidx and /dev/null differ diff --git a/.vs/fxalloc.slnx/v18/.wsuo b/.vs/fxalloc.slnx/v18/.wsuo deleted file mode 100644 index cbfc194..0000000 Binary files a/.vs/fxalloc.slnx/v18/.wsuo and /dev/null differ diff --git a/.vs/fxalloc.slnx/v18/Browse.VC.db b/.vs/fxalloc.slnx/v18/Browse.VC.db deleted file mode 100644 index b34e063..0000000 Binary files a/.vs/fxalloc.slnx/v18/Browse.VC.db and /dev/null differ diff --git a/.vs/fxalloc.slnx/v18/DocumentLayout.json b/.vs/fxalloc.slnx/v18/DocumentLayout.json deleted file mode 100644 index 56f038c..0000000 --- a/.vs/fxalloc.slnx/v18/DocumentLayout.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "Version": 1, - "WorkspaceRootPath": "C:\\projects\\fullstack\\neurox\\ccpp\\fxalloc\\", - "Documents": [], - "DocumentGroupContainers": [ - { - "Orientation": 0, - "VerticalTabListWidth": 256, - "DocumentGroups": [] - } - ] -} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite deleted file mode 100644 index b9f9921..0000000 Binary files a/.vs/slnx.sqlite and /dev/null differ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b4d8c35 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools" +} \ No newline at end of file diff --git a/PROGRESS.md b/PROGRESS.md index 2b127a2..07e942a 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -1,4 +1,4 @@ -# ccpp/fxalloc/PROGRESS.md +# FXAlloc PROGRESS.md ## Формат * Даты следуют в обратном хронологическом порядке diff --git a/README.md b/README.md index 5326977..2161b70 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# ccpp/fxalloc/README.md +# FXAlloc README.md # Описание diff --git a/TODO.md b/TODO.md index 24f9c8a..27d503a 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,4 @@ -# ccpp/fxalloc/TODO.md +# FXAlloc TODO.md ## Информация * Файл для отслеживания текущих задач модуля **FXAlloc** diff --git a/headers/_FXAlloc.h b/headers/_FXAlloc.h index 88b471c..38cc9f0 100644 --- a/headers/_FXAlloc.h +++ b/headers/_FXAlloc.h @@ -9,6 +9,29 @@ #endif +#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 201112L) + #error "C11 standard is required for _Atomic support" +#endif + + +#if defined(__clang__) + // Clang: _Atomic поддерживается в C11 во всех актуальных версиях + +#elif defined(__GNUC__) + #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 9) + #error "GCC < 4.9 does not support _Atomic (C11)" + #endif + +#elif defined(_MSC_VER) + #if _MSC_VER < 1930 // VS 2022+ (_MSC_VER >= 1930) + #error "MSVC < VS 2022 (_MSC_VER < 1930) does not support _Atomic (C11)" + #endif + +#else + #error "Unsupported compiler. Only Clang, GCC >=4.9, and MSVC VS 2022+ support _Atomic in C11" +#endif + + typedef struct FXMemoryBlock FXMemoryBlock; @@ -30,17 +53,17 @@ typedef struct FXMemoryBlock FXMemoryBlock; /** - * @brief Пул выделяемый для отдельно взятого потока + * @brief Грейдовый пул выделяемый для градации + * */ typedef struct FXGradePool { - FXMemoryBlock* prealloced; - FXMemoryBlock* lifo; - FXMemoryBlock* list_first; - FXMemoryBlock* list_last; - uint32_t ntotal; - uint32_t nbusy; - uint32_t nalloc; - uint32_t nprealloc; + FXMemoryBlock* prealloced; ///< Преаллоцированные блоки + FXMemoryBlock* lifo; ///< Стэк свободных блоков + FXMemoryBlock* list; ///< Список аллоцированных блоков + uint32_t ntotal; ///< Блоков всего + uint32_t nbusy; ///< Блоков занято + uint32_t nalloc; ///< Блоков алоцировано через `malloc` + uint32_t nprealloc; ///< Блоков преаллоцировано } FXGradePool; #pragma pack(push, 8)