Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 818389b

Browse files
committedMar 2, 2022
fixed broken update
really remove -static compilation removed useless collect timestamp provided by the user implemented forceWindowUpdate fixed the old leak fixed memory leak separated debug info created time function removed TODO first version of window diff window test fixed insertWindow (was looping) no fixedData when reallyRemove is active made a copy of the context after every insertion in streaming mode added support for insert(id(), ...) added vtry to runSql renamed --stream to --updates renamed SQLive into SKDB fixed typo fixed string_utf8_size
1 parent 5137d55 commit 818389b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+836
-358
lines changed
 

‎Context.sk

+55-3
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,37 @@ mutable class Context{
306306
}
307307
}
308308

309+
readonly fun mclone(): mutable this {
310+
mutable static{
311+
pwd => this.pwd,
312+
dirs => this.dirs,
313+
reads => this.reads,
314+
time => this.time,
315+
tick => this.tick,
316+
lazyCapacity => this.lazyCapacity,
317+
toUpdate => this.toUpdate,
318+
deps => this.deps,
319+
debugMode => this.debugMode,
320+
failOnExn => this.failOnExn,
321+
hasPre => this.hasPre,
322+
newDirs => this.newDirs,
323+
toReset => this.toReset,
324+
globals => this.globals,
325+
asyncList => this.asyncList,
326+
dirty => this.dirty,
327+
dirtyReaders => this.dirtyReaders,
328+
unsafeReuse => this.unsafeReuse,
329+
arrowStack => this.arrowStack,
330+
lazyGets => this.lazyGets,
331+
lazyGetsQueueIn => this.lazyGetsQueueIn,
332+
lazyGetsQueueOut => this.lazyGetsQueueOut,
333+
lazyGetsRefCount => this.lazyGetsRefCount,
334+
reallyRemoveDir => this.reallyRemoveDir,
335+
sessions => this.sessions,
336+
removeSubDirs => this.removeSubDirs,
337+
}
338+
}
339+
309340
static fun fromSaved(ctx: Context): mutable this {
310341
mutable static{
311342
pwd => ctx.pwd,
@@ -446,6 +477,7 @@ mutable class Context{
446477
totalSize => 0,
447478
fixedData => FixedDir::create(),
448479
creator => this.currentArrow(),
480+
reallyRemove => dir.reallyRemove,
449481
};
450482
dir.unsafeIterKeys((key, _time) -> {
451483
values = dir.getArrayRaw(key).collect(Array);
@@ -651,10 +683,12 @@ mutable class Context{
651683
mutable fun mkdir<T: File>(
652684
conv: File ~> T,
653685
dirName: DirName,
686+
reallyRemove: Bool,
654687
content: Array<(BaseName, T)> = Array[],
655688
): EHandle<T> {
656689
this.mkdirMulti(
657690
dirName,
691+
reallyRemove,
658692
content.map(kv -> {
659693
(key, value) = kv;
660694
(key, Array[value])
@@ -665,6 +699,7 @@ mutable class Context{
665699

666700
mutable fun mkdirMulti(
667701
dirName: DirName,
702+
reallyRemove: Bool,
668703
content: Array<(BaseName, Array<File>)> = Array[],
669704
): void {
670705
if (this.dirs.state.containsKey(dirName)) {
@@ -706,7 +741,15 @@ mutable class Context{
706741

707742
totalSize = fixedData.data.size();
708743
creator = this.currentArrow();
709-
dir = EagerDir{time, input => true, dirName, fixedData, totalSize, creator};
744+
dir = EagerDir{
745+
time,
746+
input => true,
747+
dirName,
748+
fixedData,
749+
totalSize,
750+
creator,
751+
reallyRemove,
752+
};
710753
this.setDir(dirName, dir);
711754
this.!newDirs = this.newDirs.add(dirName);
712755
}
@@ -716,6 +759,7 @@ mutable class Context{
716759
dirName: DirName,
717760
content: Array<Row>,
718761
decompress: Row ~> FixedRow<Array<File>>,
762+
reallyRemove: Bool,
719763
): EHandle<T> {
720764
if (this.dirs.state.containsKey(dirName)) {
721765
throw DirAlreadyExists(dirName);
@@ -726,7 +770,15 @@ mutable class Context{
726770

727771
totalSize = fixedData.data.size();
728772
creator = this.currentArrow();
729-
dir = EagerDir{time, input => true, dirName, fixedData, totalSize, creator};
773+
dir = EagerDir{
774+
time,
775+
input => true,
776+
dirName,
777+
fixedData,
778+
totalSize,
779+
creator,
780+
reallyRemove,
781+
};
730782
this.setDir(dirName, dir);
731783
this.!newDirs = this.newDirs.add(dirName);
732784
EHandle(conv, dirName)
@@ -953,7 +1005,7 @@ fun resolveContext(
9531005
| Some(x) -> SKFS.IntFile::fromFile(x).value
9541006
};
9551007
print_error("Error, line " + line + ": " + err.getMessage());
956-
exit(2);
1008+
skipExit(2);
9571009
}),
9581010
)
9591011
};

‎CountQuery.sk

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ fun testCount(): mutable SKFS.Context {
6565
dirSInput = context.mkdir(
6666
SKFS.StringFile::fromFile,
6767
sinput,
68+
false,
6869
inputFiles.items().collect(Array),
6970
);
7071

@@ -79,6 +80,7 @@ fun testCount(): mutable SKFS.Context {
7980
dirSumInput = context.mkdir(
8081
SKFS.StringFile::fromFile,
8182
sumInput,
83+
false,
8284
inputSumFiles.items().collect(Array),
8385
);
8486
_sumDir = SKFS.sumDir(

0 commit comments

Comments
 (0)
Please sign in to comment.