Print loaded files and errors, enable loading and searching

This commit is contained in:
Krzosa Karol
2024-07-06 09:51:39 +02:00
parent e3a176b2f9
commit 22828c9d23
7 changed files with 173 additions and 94 deletions

View File

@@ -401,9 +401,9 @@ struct Array {
}
void bounded_add(T item) {
Assert(len + 1 <= cap);
try_growing(); // in case of error
data[len++] = item;
if (len + 1 <= cap) {
data[len++] = item;
}
}
T *alloc(const T &item) {

View File

@@ -11,6 +11,7 @@ struct ThreadCtx {
};
struct WorkQueue {
int32_t thread_count;
WorkQueueEntry entries[256];
int64_t volatile index_to_write;
int64_t volatile index_to_read;
@@ -27,4 +28,6 @@ struct ThreadStartupInfo {
void PushWork(WorkQueue *wq, void *data, WorkQueueCallback *callback);
void InitWorkQueue(WorkQueue *queue, uint32_t thread_count, ThreadStartupInfo *info);
void WaitUntilCompletion(WorkQueue *wq);
void WaitUntilCompletion(WorkQueue *wq);
int64_t AtomicIncrement(volatile int64_t *i);

View File

@@ -51,6 +51,7 @@ DWORD WINAPI WorkQueueThreadEntry(LPVOID param) {
}
void InitWorkQueue(WorkQueue *queue, uint32_t thread_count, ThreadStartupInfo *info) {
queue->thread_count = thread_count;
queue->index_to_read = 0;
queue->index_to_write = 0;
queue->completion_index = 0;