macOS/Apple Silicon port: NEON kernels + platform shim (PR #1 by RDouglasSharp)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include "json.h"
|
||||
#include "compat.h"
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
@@ -78,7 +79,13 @@ static int st_open_fd(shards *S, const char *path) {
|
||||
int fd = open(path, O_RDONLY);
|
||||
if (fd < 0) { perror(path); exit(1); }
|
||||
S->paths[S->nfd] = strdup(path); S->fds[S->nfd] = fd;
|
||||
#ifdef O_DIRECT
|
||||
S->dfds[S->nfd] = open(path, O_RDONLY | O_DIRECT); /* eager: lookup poi thread-safe */
|
||||
#elif defined(__APPLE__)
|
||||
S->dfds[S->nfd] = compat_open_direct(path); /* macOS: F_NOCACHE ~ O_DIRECT */
|
||||
#else
|
||||
S->dfds[S->nfd] = -1; /* niente equivalente: solo buffered */
|
||||
#endif
|
||||
S->nfd++;
|
||||
return fd;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user