Using FindFirstFileA() instead of CreateFileA() to get the file size

Since we already call FindFirstFileA() and it returns the size there is
no need to open/close every file to get it's size
This commit is contained in:
2026-03-10 19:54:52 +01:00
parent 1fa306643f
commit f904337878
5 changed files with 77 additions and 17 deletions

View File

@@ -46,18 +46,25 @@ static double timer_stop(HiResTimer *t) {
}
// MPMC Queue
static MPMCQueue g_dir_queue;
static MPMCQueue g_file_queue;
typedef struct {
mem_arena *path_arena;
mem_arena *meta_arena;
MPMCQueue *dir_queue;
MPMCQueue *file_queue;
} ScannerContext;
typedef struct {
MPMCQueue *queue;
mem_arena *arena;
} WorkerContext;
/* Scan folders */
typedef struct DirQueue DirQueue;
void scan_folder_windows_parallel(const char *base, DirQueue *q);
void scan_folder_posix_parallel(const char *base, DirQueue *q);
typedef struct DirQueue DirQueue;
typedef struct DirJob {
char *path;
@@ -80,3 +87,7 @@ typedef struct DirQueue {
pthread_cond_t cond;
#endif
} DirQueue;
// void scan_folder_windows_parallel(const char *base, ScannerContext *ctx);
// void scan_folder_posix_parallel(const char *base, ScannerContext *ctx);
void scan_folder_windows_parallel(const char *base, DirQueue *q);