Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 265581f

Browse files
committed
Merge branch 'dev' of https://github.com/janhq/cortex.cpp into s/fix/bgr-tasks
2 parents 9097b1c + ca2327a commit 265581f

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

docs/docs/architecture/cortex-db.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ This document outlines Cortex database architecture which is designed to store a
1616
files and more.
1717

1818
## Table Structure
19-
### schema Table
20-
The `schema` table is designed to hold schema version for cortex database. Below is the structure of the table:
19+
### schema_version Table
20+
The `schema_version` table is designed to hold schema version for cortex database. Below is the structure of the table:
2121

2222
| Column Name | Data Type | Description |
2323
|--------------------|-----------|---------------------------------------------------------|
24-
| schema_version | INTEGER | A unique schema version for database. |
24+
| version | INTEGER | A unique schema version for database. |
2525

2626

2727
### models Table
@@ -64,10 +64,10 @@ Below is the structure of the table:
6464
| api_key | TEXT | |
6565
| url | TEXT | |
6666
| version | TEXT | The current version of the engine. |
67-
| variant | TEXT | |
67+
| variant | TEXT | A string that specifies the specific configuration or build variant of the engine. |
6868
| status | TEXT | Current status of the engine (e.g., "downloaded", "downloadable"). |
6969
| metadata | TEXT | Additional metadata or information about the engine. |
70-
| date_ceated | TEXT | Date when the engine was downloaded. |
70+
| date_created | TEXT | Date when the engine was downloaded. |
7171
| date_updated | TEXT | Date when the engine was last updated. |
7272

7373
### files Table
@@ -79,5 +79,5 @@ The `files` table is designed to hold metadata about objects dowloaded via Corte
7979
| object | TEXT | The type of hardware. |
8080
| purpose | TEXT | Purpose of file |
8181
| filename | TEXT | The name of the file. |
82-
| created_at | INTEGER | Date when file was created |
83-
| bytes | INTEGER | |
82+
| created_at | INTEGER | Date when file was created. |
83+
| bytes | INTEGER | Size of the file on disk in bytes. |

engine/utils/hardware/ram_info.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ inline Memory GetMemoryInfo() {
1717
hwinfo::Memory m;
1818
#if defined(__APPLE__) && defined(__MACH__)
1919
int64_t total_memory = 0;
20-
int64_t used_memory = 0;
20+
int64_t avail_memory = 0;
2121

2222
size_t length = sizeof(total_memory);
2323
sysctlbyname("hw.memsize", &total_memory, &length, NULL, 0);
2424

25-
// Get used memory (this is a rough estimate)
25+
// Get avail memory (this is a rough estimate)
2626
vm_size_t page_size;
2727
mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
2828

@@ -31,12 +31,10 @@ inline Memory GetMemoryInfo() {
3131

3232
if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&vm_stat,
3333
&count) == KERN_SUCCESS) {
34-
used_memory =
35-
(vm_stat.active_count + vm_stat.inactive_count + vm_stat.wire_count) *
36-
page_size;
34+
avail_memory = (vm_stat.free_count + vm_stat.inactive_count) * page_size;
3735
}
3836
return Memory{.total_MiB = ByteToMiB(total_memory),
39-
.available_MiB = ByteToMiB(total_memory - used_memory)};
37+
.available_MiB = ByteToMiB(avail_memory)};
4038
#elif defined(__linux__) || defined(_WIN32)
4139
return Memory{.total_MiB = ByteToMiB(m.total_Bytes()),
4240
.available_MiB = ByteToMiB(m.available_Bytes())};

0 commit comments

Comments
 (0)