Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-and-itasks
clean-ide
Commits
258e9f91
Commit
258e9f91
authored
Apr 25, 2008
by
John van Groningen
Browse files
optimize abc cache, replace old data with new data, if a file is modified,
instead of adding the new data and keeping the old data
parent
8f89101f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Pm/PmAbcMagic.icl
View file @
258e9f91
...
...
@@ -79,8 +79,14 @@ Combined path date abccache files
=
Read_Version_and_Options
file
#
(
file
,
dInfo
)
=
ParseABCDependencies
file
#
(_,
files
)
=
fclose
file
files
#!
abccache
=
AC_Add
path
date
dInfo
abccache
=
((
cInfo
,
dInfo
,
abccache
),
files
)
#!
maxi
=
abccache
.
maxi
#
(
cache_index
,
abccache
)
=
search_path_in_cache
path
maxi
abccache
|
cache_index
<
0
#!
abccache
=
AC_Add
path
date
dInfo
abccache
=
((
cInfo
,
dInfo
,
abccache
),
files
)
#!
abccache
=
{
abccache
&
cache
.[
cache_index
]={
c_path
=
path
,
c_date
=
date
,
c_info
=
dInfo
}}
=
((
cInfo
,
dInfo
,
abccache
),
files
)
where
dummyCinf
=
(
False
,
False
,
-1
,
DefaultABCOptions
)
dummyDinf
=
dummyDepInfo
...
...
@@ -232,21 +238,14 @@ where
newstuff
::
ABCStuff
newstuff
=
{
c_path
=
path
,
c_date
=
date
,
c_info
=
info
}
UCache
::
!
ABCStuff
!
Int
!*{!
ABCStuff
}
->
*{!
ABCStuff
}
UCache
e
i
a
=
{
a
&
[
i
]
=
e
}
ParseABCDependencies`
::
!
Pathname
!
DATE
!*
ABCCache
!
Files
->
((!
Bool
,
!
List
Modulename
,
!
Maybe
ModuleDate
,
!
List
ModuleDate
,
!
List
LinkObjFileName
,
!
List
LinkLibraryName
,
!*
ABCCache
/*, !FileInfoCache*/
),
!
Files
);
ParseABCDependencies`
path
abcdate
abccache
files
=
AC_Look
path
abccache
files
where
AC_Look
path
abccache
=:{
maxi
}
files
#
date
=
abcdate
#
(
foundl
,
abccache
)
=
uSeqArray
(\{
c_path
,
c_date
}->
c_path
==
path
&&
eqDate
c_date
date
)
(\{
c_info
}->
c_info
)
(
maxi
)
abccache
|
isEmpty
foundl
#
(
cache_index
,
abccache
)
=
search_path_in_cache
path
maxi
abccache
|
cache_index
<
0
#
(
opened
,
file
,
files
)
=
fopen
path
FReadData
files
|
not
opened
#
(
b
,
c
,
d
,
e
,
f
)
=
dummyDepInfo
...
...
@@ -255,20 +254,19 @@ where
#
(_,
files
)
=
fclose
file
files
#!
abccache
=
AC_Add
path
date
(
b
,
c
,
d
,
e
,
f
)
abccache
=
((
True
,
b
,
c
,
d
,
e
,
f
,
abccache
),
files
)
#
(
b
,
c
,
d
,
e
,
f
)
=
hd
foundl
=
((
True
,
b
,
c
,
d
,
e
,
f
,
abccache
),
files
)
#
({
c_date
,
c_info
},
abccache
)
=
abccache
!
cache
.[
cache_index
]
|
eqDate
c_date
date
#
(
b
,
c
,
d
,
e
,
f
)=
c_info
=
((
True
,
b
,
c
,
d
,
e
,
f
,
abccache
),
files
)
#
(
opened
,
file
,
files
)
=
fopen
path
FReadData
files
|
not
opened
#
(
b
,
c
,
d
,
e
,
f
)
=
dummyDepInfo
=
((
False
,
b
,
c
,
d
,
e
,
f
,
abccache
),
files
)
#
(
file
,(
b
,
c
,
d
,
e
,
f
))
=
ParseABCDependencies
file
#
(_,
files
)
=
fclose
file
files
#!
abccache
=
{
abccache
&
cache
.[
cache_index
]={
c_path
=
path
,
c_date
=
date
,
c_info
=(
b
,
c
,
d
,
e
,
f
)}}
=
((
True
,
b
,
c
,
d
,
e
,
f
,
abccache
),
files
)
uSeqList
f
g
acc
[]
=
([],
reverse
acc
)
uSeqList
f
g
acc
[
h
:
t
]
|
f
h
=
([
g
h
],
reverse
acc
++
[
h
:
t
])
=
uSeqList
f
g
[
h
:
acc
]
t
uSeqArray
f
g
n
c
|
n
<
0
=
([],
c
)
#
(
r
,
c
)
=
c
!
cache
.[
n
]
|
f
r
=
([
g
r
],
c
)
=
uSeqArray
f
g
(
dec
n
)
c
eqDate
l
r
=
l
.
exists
==
r
.
exists
&&
l
.
yy
==
r
.
yy
...
...
@@ -278,6 +276,14 @@ where
&&
l
.
m
==
r
.
m
&&
l
.
s
==
r
.
s
search_path_in_cache
::
!{#
Char
}
!
Int
!*
ABCCache
->
*(!
Int
,!*
ABCCache
)
search_path_in_cache
path
n
c
|
n
<
0
=
(
-1
,
c
)
|
c
.
cache
.[
n
].
c_path
==
path
=
(
n
,
c
)
=
search_path_in_cache
path
(
dec
n
)
c
// Find the module depencies in the .abc files
dummyDepInfo
=
(
Nil
,
Nothing
,
Nil
,
Nil
,
Nil
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment