Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
0445eb8b
Commit
0445eb8b
authored
Mar 09, 1999
by
Thuy Nguyen
Committed by
Alexandre Julliard
Mar 09, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Smarter way of searching for a free block.
parent
c08b9c5b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
storage32.c
ole/storage32.c
+21
-6
storage32.h
ole/storage32.h
+1
-0
No files found.
ole/storage32.c
View file @
0445eb8b
...
...
@@ -1921,6 +1921,11 @@ HRESULT StorageImpl_Construct(
* There is no block depot cached yet.
*/
This
->
indexBlockDepotCached
=
0xFFFFFFFF
;
/*
* Start searching for free blocks with block 0.
*/
This
->
prevFreeBlock
=
0
;
/*
* Create the block chain abstractions.
...
...
@@ -2026,7 +2031,10 @@ ULONG StorageImpl_GetNextFreeBigBlock(
ULONG
blocksPerDepot
=
This
->
bigBlockSize
/
sizeof
(
ULONG
);
ULONG
nextBlockIndex
=
BLOCK_SPECIAL
;
int
depotIndex
=
0
;
ULONG
blockNoInSequence
=
0
;
ULONG
freeBlock
=
BLOCK_UNUSED
;
depotIndex
=
This
->
prevFreeBlock
/
blocksPerDepot
;
depotBlockOffset
=
(
This
->
prevFreeBlock
%
blocksPerDepot
)
*
sizeof
(
ULONG
);
/*
* Scan the entire big block depot until we find a block marked free
...
...
@@ -2115,15 +2123,16 @@ ULONG StorageImpl_GetNextFreeBigBlock(
if
(
depotBuffer
!=
0
)
{
depotBlockOffset
=
0
;
while
(
(
(
depotBlockOffset
/
sizeof
(
ULONG
)
)
<
blocksPerDepot
)
&&
(
nextBlockIndex
!=
BLOCK_UNUSED
))
{
StorageUtl_ReadDWord
(
depotBuffer
,
depotBlockOffset
,
&
nextBlockIndex
);
if
(
nextBlockIndex
!=
BLOCK_UNUSED
)
blockNoInSequence
++
;
if
(
nextBlockIndex
==
BLOCK_UNUSED
)
{
freeBlock
=
(
depotIndex
*
blocksPerDepot
)
+
(
depotBlockOffset
/
sizeof
(
ULONG
));
}
depotBlockOffset
+=
sizeof
(
ULONG
);
}
...
...
@@ -2132,9 +2141,12 @@ ULONG StorageImpl_GetNextFreeBigBlock(
}
depotIndex
++
;
depotBlockOffset
=
0
;
}
return
blockNoInSequence
;
This
->
prevFreeBlock
=
freeBlock
;
return
freeBlock
;
}
/******************************************************************************
...
...
@@ -2309,6 +2321,9 @@ void StorageImpl_FreeBigBlock(
ULONG
blockIndex
)
{
StorageImpl_SetNextBlockInChain
(
This
,
blockIndex
,
BLOCK_UNUSED
);
if
(
blockIndex
<
This
->
prevFreeBlock
)
This
->
prevFreeBlock
=
blockIndex
;
}
/************************************************************************
...
...
ole/storage32.h
View file @
0445eb8b
...
...
@@ -298,6 +298,7 @@ struct StorageImpl
ULONG
blockDepotCached
[
NUM_BLOCKS_PER_DEPOT_BLOCK
];
ULONG
indexBlockDepotCached
;
ULONG
prevFreeBlock
;
/*
* Abstraction of the big block chains for the chains of the header.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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