Skip to content
This repository was archived by the owner on Mar 16, 2022. It is now read-only.
This repository was archived by the owner on Mar 16, 2022. It is now read-only.

LA4Falcon -m runs out of memory: Move to Nim #25

Description

@pb-cdunn
  82 FILE *Fopen(char *name, char *mode)
  83 { FILE *f;
  84   char newmode[3];
  85
  86   if (name == NULL || mode == NULL)
  87     return (NULL);
  88   if (strcmp(mode, "r") == 0) {
  89       strcpy(newmode,"rm");
  90   } else {
  91       strcpy(newmode,mode);
  92   }
  93   if ((f = fopen(name,newmode)) == NULL)
  94     EPRINTF(EPLACE,"%s: Cannot open %s for '%s'\n",Prog_Name,name,mode);
  95   return (f);
  96 }

For the DB, we use GNU fopen(filename, "rm"), which uses "mmap" for the file.

That avoids problems of filesystem-latency, but unfortunately I don't think GNU fopen() uses the MAP_SHARED flag, so separate procs will not share their read-only mmapped DB.

One solution is to use r instead of rm. However, then we are back to filesystem latency problems.

A better solution is to run LA4Falcon as a function, multi-threaded in a program with its consumer. A Nim version might help with that.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions