summary refs log tree commit diff stats
path: root/lib/pure/memfiles.nim
Commit message (Collapse)AuthorAgeFilesLines
* This has been unnecessary as long as rawNewObj has called zeroMem, (#8867)c-blake2018-09-041-1/+0
| | | | and more recently indexing past the Nim-logical end has become illegal making this line cause a crash.
* Don't depend on string.h in codegen (#8299)Yuriy Glukhov2018-07-131-2/+1
|
* make tmemfile2 work againAraq2018-07-061-1/+2
|
* Add MemMapFileStream. Fixes in memFiles. (#7944)Dmitry Atamanov2018-06-141-9/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add MemMapFileStream * Added tests * Fixed bug in memfiles (zero index for string) * Added flush to changelog * Attempt to fix Win's nuances * Fix attempt to fix * Continue... * And again... * Reworked tests (all for win on Win) * Fixes in flush (Win) * Replace fn vars to consts * Added the attempts parameter to the flush * Replace while to for * Move to memfiles * Use Natural instead of uint * Better error messages for append mode. Handle specific cases.
* remove deprecated stuff from the stdlib; introduce better deprecation warningsAraq2018-05-051-2/+0
|
* memfiles: better error checking for Windows; refs #6361Araq2018-01-031-4/+7
|
* Update memfiles.nim (#6328)Denis Rumyantsev2017-09-151-1/+1
| | | FIX error in MemFile fileSize
* Remove expr/stmt (#5857)Arne Döring2017-07-251-3/+3
|
* Fixes incorrect fd==0 test on Unix; Conserves handles by default. (#5512)c-blake2017-03-121-8/+20
| | | | | | | | | | | | | | * Fix 2 problems. First, 0 is a valid fd on Unix (easily gotten if user first closes all fds and then starts using memfiles). Use -1 instead for an invalid fd. Second, it is best practice to conserve open fds on Unix and file handles on Windows. These handles are not needed unless the user wants to remap the memory with ``mapMem`` (or a hypothetical future ``proc resize``). Adding a new bool param ``allowRemap=false`` to ``memfiles.open`` solves this cleanly in a "mostly" backward compatible way. This is only "mostly" because the default ``false`` case does not keep unneeded resources allocated, but that most sensible default means that any ``mapMem`` callers need to fix all their open calls to have allowRemap=true, as this PR also does for tmemfiles2.nim. * Include backwards compatibility note.
* Oops - forgot export marker.Charles Blake2016-12-221-1/+1
|
* Add a proc `==` for MemSlice.Charles Blake2016-12-221-0/+5
|
* Add doco on mapMem(), extend doco on open(), and add extra lines space for ↵James Parkinson2016-08-051-7/+27
| | | | readability
* fix types of ansi_c/sysio to more closely match C ABIJacek Sieka2016-06-051-4/+2
| | | | | also fixes some instances of using C library functions when there are nim alternatives available
* Bug fix: change non-fmRead file mode to set GENERIC_READ or GENERIC_WRITEJamesP2015-09-241-1/+2
| | | | | instead of GENERIC_ALL which on 64bit windows rasied an [OSError] exception
* change type of windows handles to HandleJamesP2015-09-241-3/+3
|
* fix wasOpened reference and set to false on closeJamesP2015-09-231-1/+2
|
* Add wasOpened flag for windows, so not attempt close when unopenedJamesP2015-09-221-1/+4
|
* Undo zero checkJamesP2015-09-221-1/+1
|
* bug fix: close() only unmapViewOfFile() when fHandle is valid.JamesP2015-09-121-1/+1
| | | | | Added extra test on windows close so if already closed it doesn't throw an exception.
* lib: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-5/+5
| | | | via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
* Add note about what is included.Charles Blake2015-08-041-0/+3
|
* Use hyperlinks to refer to other procs.Charles Blake2015-08-041-6/+8
|
* Expand memSlices doc comment & use better example.Charles Blake2015-08-041-14/+27
| | | | Have lines() iterators docs point back to memSlices() for details.
* Spruce up doc comments as per dom96 suggestions.Charles Blake2015-08-031-7/+12
|
* toString --> `$`.Charles Blake2015-08-031-1/+1
|
* Try to get examples to render right as HTML.Charles Blake2015-08-021-1/+5
|
* Add some example code blocks.Charles Blake2015-08-021-2/+10
|
* Quote the \ in doc comments.Charles Blake2015-08-021-5/+5
|
* Add some little one-line doc comment of MemSlice.Charles Blake2015-08-021-1/+1
|
* Add top of module comment. Re-order definitions toCharles Blake2015-08-021-6/+36
| | | | | | | | | | type, then converter, then 3 iterators lowest- to highest-level (also fastest to slowest) including a new intermediate iterator lines(MemFile, buffer) that is more like readLine(File) in case that helps anyone port code. Add doc comments. Also have toString just use newString+c_memcpy instead of currently fragile toNimStr which Araq wants a separate PR for.
* Nix unchecked which has no semantics for objects.Charles Blake2015-08-021-1/+1
|
* cstring->pointer in MemSlice to make consistent with MemFile andCharles Blake2015-07-291-8/+8
| | | | | also to make more clear the care required to use MemSlice instances. (E.g., memXXX functions rather than strXXX functions).
* Remove NUL termination unneeded post toNimStr fix.Charles Blake2015-07-281-1/+0
|
* Rename [rR]ecord->[mM]emSlice, rec->ms, End->ending. Also update some comments.Charles Blake2015-07-261-20/+20
|
* Beg->data, Len->size to address Varriount's issue. I was unaware ofCharles Blake2015-07-241-11/+11
| | | | lower case members as a strict style convention.
* Add MemFile text interface factored so users can optionally skip Nim stringCharles Blake2015-07-241-0/+32
| | | | | | construction (e.g. to filter many lines out before building strings). Only Windows and/or Unix line endings are supported by default, though fiddling with delim/eat arguments can probably support archaic MacOS9 files.
* lib/pure/e-o - Dropped 'T' from typespdw2015-06-041-1/+1
|
* Happy new year!Guillaume Gelin2015-01-061-1/+1
|
* Nimrod renamed to NimAraq2014-08-281-1/+1
|
* big renameAraq2014-08-281-2/+2
|
* big renameAraq2014-08-271-16/+17
|
* renamefestAraq2014-08-231-2/+2
|
* Revert "Do not automatically use MAP_POPULATE for opening mmap files."Nick Greenfield2014-07-231-9/+3
| | | | | | | This reverts commit cba75db4e36b3af0d39b5717141a971e6d558554. The prior commit yields a compiler error 'error: lvalue required as left operand of assignment; MAP_POPULATE = ((int) 0);'. So for now this branch *always* adds MAP_POPULATE when using the open and mapMem procs.
* Do not automatically use MAP_POPULATE for opening mmap files.Nick Greenfield2014-07-231-3/+9
| | | | | Adds use_map_populate keyword to memfiles.open and memfiles.mapMem to govern MAP_POPULATE use. This is set to false by default.
* Add automatic MAP_POPULATE flag for opening read_only (MAP_PRIVATE) and ↵Nick Greenfield2014-07-231-2/+2
| | | | shared (MAP_SHARED) mmap files.
* Update posix open() call to incl. permissionsboydgreenfield2014-05-051-1/+4
| | | This explicitly grants user read/write access to newly-created mmap files. Previously, on some systems files would be created but could not be re-opened as the user lacked sufficient permissions.
* Clarify newFileSize & mappedSize params in memfiles.open() docsboydgreenfield2014-05-051-3/+16
|
* added mapMem/unmapMem to memfiles; untestedAraq2014-03-221-4/+41
|
* case consistency for linuxAraq2013-12-291-7/+7
|
* case consistency part 4Araq2013-12-271-19/+19
|
vel&id=caf7717cb8904dcdbb72b9b3a7b6dece01ed5768'>^
e25474154 ^
4de84024e ^


d3255f708 ^
7063670a2 ^


d3255f708 ^
4de84024e ^





92b8fac94 ^
4de84024e ^



92b8fac94 ^
4de84024e ^

7063670a2 ^


d3255f708 ^
4de84024e ^




e25474154 ^

d3255f708 ^
4de84024e ^


d3255f708 ^

4de84024e ^


d3255f708 ^
4de84024e ^







e25474154 ^
4de84024e ^
d3255f708 ^
4de84024e ^


d3255f708 ^
4de84024e ^


d3255f708 ^
4de84024e ^

d3255f708 ^
4de84024e ^




e25474154 ^
d3255f708 ^
4de84024e ^
c40249cd4 ^
92b8fac94 ^
4de84024e ^



d3255f708 ^


e25474154 ^
4de84024e ^


92b8fac94 ^
657dca5c3 ^
beb13ecf6 ^

4de84024e ^


d3255f708 ^
92b8fac94 ^
d3255f708 ^
4de84024e ^

d3255f708 ^
4de84024e ^

d3255f708 ^
4de84024e ^

e25474154 ^
d3255f708 ^
4de84024e ^

e25474154 ^
d3255f708 ^
4de84024e ^

d3255f708 ^
4de84024e ^

4de84024e ^
d3255f708 ^

4de84024e ^
d3255f708 ^

4de84024e ^
e25474154 ^

d3255f708 ^
4de84024e ^


c40249cd4 ^
4de84024e ^




e25474154 ^
4de84024e ^










e25474154 ^
4de84024e ^








e25474154 ^
4de84024e ^





d3255f708 ^
90db9171a ^

d3255f708 ^
90db9171a ^






7171ae62c ^

92b8fac94 ^
90db9171a ^


235bd1c47 ^
2781fea9e ^
235bd1c47 ^
4de84024e ^
235bd1c47 ^









d3255f708 ^
4de84024e ^

e25474154 ^
4de84024e ^





e25474154 ^

92b8fac94 ^
e25474154 ^
9fb36bd20 ^



e25474154 ^
90db9171a ^
4de84024e ^
d3255f708 ^
4de84024e ^
90db9171a ^


438703f59 ^
4de84024e ^
d3255f708 ^


e25474154 ^
4de84024e ^
d3255f708 ^
9fb36bd20 ^
4de84024e ^

9fb36bd20 ^
d3255f708 ^

4de84024e ^








1786e3099 ^
4de84024e ^

1786e3099 ^
bd1cb9e77 ^

d3255f708 ^
9fb36bd20 ^

d3255f708 ^
9fb36bd20 ^



d3255f708 ^
e25474154 ^
92b8fac94 ^
e25474154 ^
d3255f708 ^
866572e2e ^
d3255f708 ^
90db9171a ^



d3255f708 ^
4de84024e ^
90db9171a ^

4de84024e ^
e25474154 ^
92b8fac94 ^
e25474154 ^
90db9171a ^









92b8fac94 ^
e25474154 ^
d3255f708 ^
e25474154 ^
90db9171a ^
e25474154 ^
d3255f708 ^



e25474154 ^

d3255f708 ^
4de84024e ^

92b8fac94 ^
4de84024e ^
90db9171a ^
e25474154 ^
d3255f708 ^
90db9171a ^
2f43fdb83 ^
8b5aa221a ^

4de84024e ^
c8d270268 ^
4de84024e ^


90db9171a ^
4de84024e ^




a0b82db40 ^




d3255f708 ^
62b55592e ^


4de84024e ^
d3255f708 ^
4de84024e ^



a702524ae ^








d3255f708 ^

4de84024e ^


d3255f708 ^
4de84024e ^
d3255f708 ^
4de84024e ^



d3255f708 ^
4de84024e ^


d3255f708 ^
4de84024e ^


d3255f708 ^
4de84024e ^


d3255f708 ^
4de84024e ^






d3255f708 ^
4de84024e ^


d3255f708 ^
4de84024e ^


bd1cb9e77 ^



d3255f708 ^
4de84024e ^


d3255f708 ^
4de84024e ^


235bd1c47 ^


4de84024e ^
d3255f708 ^
7ebaf4489 ^



e25474154 ^
d3255f708 ^
e25474154 ^
d3255f708 ^
866572e2e ^
e25474154 ^
089e287c6 ^
e25474154 ^
089e287c6 ^

d3255f708 ^

866572e2e ^
92b8fac94 ^
c51763915 ^
92b8fac94 ^
c51763915 ^
bd1cb9e77 ^
e25474154 ^
7fcbdc6d4 ^
d3255f708 ^
866572e2e ^
7fcbdc6d4 ^
e25474154 ^
d3255f708 ^

866572e2e ^
d3255f708 ^
92b8fac94 ^
866572e2e ^
d3255f708 ^
7063670a2 ^






d3255f708 ^



d171a8b36 ^
e25474154 ^
d3255f708 ^
d171a8b36 ^
e25474154 ^
d3255f708 ^
d171a8b36 ^
d3255f708 ^
e25474154 ^
d3255f708 ^
73c6efdf6 ^
e25474154 ^
36e25a684 ^
92b8fac94 ^
62b55592e ^
e25474154 ^


d3255f708 ^
78f37b233 ^
7063670a2 ^
e25474154 ^
fc9fdc2b9 ^
e25474154 ^
091c1b307 ^
e25474154 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590