Re: ifile lexing question
"Clemens Fischer" <[email protected]>
| Newsgroups | gmane.mail.ifile.general |
|---|---|
| Message-ID | <[email protected]> |
[email protected] writes: > [email protected] writes: > >> I'm not sure there's a clean way to maintain the internal, dynamic >> data structure using mmap. > > Not that this is necessarily a good idea, but you could use System V > shared memory segments for this - they're mappable, and persistent > across program starts and stops. See shmget(2) and shmat(2). not a bad idea considering that ifile already uses other sysV features (semaphores). regarding the mmap'ing: you could stat(2) the file for its size, then preallocate this space plus hefty padding. ah! maybe you mean the memory allocated by ifile for the table: in that case i think you shouldn't worry. you said yourself that ifile spends only a second in that area. the same goes if you alloc via shmget. never done that before, though. -- clemens