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
Show 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
...
@@ -1923,6 +1923,11 @@ HRESULT StorageImpl_Construct(
...
@@ -1923,6 +1923,11 @@ HRESULT StorageImpl_Construct(
This
->
indexBlockDepotCached
=
0xFFFFFFFF
;
This
->
indexBlockDepotCached
=
0xFFFFFFFF
;
/*
/*
* Start searching for free blocks with block 0.
*/
This
->
prevFreeBlock
=
0
;
/*
* Create the block chain abstractions.
* Create the block chain abstractions.
*/
*/
This
->
rootBlockChain
=
This
->
rootBlockChain
=
...
@@ -2026,7 +2031,10 @@ ULONG StorageImpl_GetNextFreeBigBlock(
...
@@ -2026,7 +2031,10 @@ ULONG StorageImpl_GetNextFreeBigBlock(
ULONG
blocksPerDepot
=
This
->
bigBlockSize
/
sizeof
(
ULONG
);
ULONG
blocksPerDepot
=
This
->
bigBlockSize
/
sizeof
(
ULONG
);
ULONG
nextBlockIndex
=
BLOCK_SPECIAL
;
ULONG
nextBlockIndex
=
BLOCK_SPECIAL
;
int
depotIndex
=
0
;
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
* Scan the entire big block depot until we find a block marked free
...
@@ -2115,15 +2123,16 @@ ULONG StorageImpl_GetNextFreeBigBlock(
...
@@ -2115,15 +2123,16 @@ ULONG StorageImpl_GetNextFreeBigBlock(
if
(
depotBuffer
!=
0
)
if
(
depotBuffer
!=
0
)
{
{
depotBlockOffset
=
0
;
while
(
(
(
depotBlockOffset
/
sizeof
(
ULONG
)
)
<
blocksPerDepot
)
&&
while
(
(
(
depotBlockOffset
/
sizeof
(
ULONG
)
)
<
blocksPerDepot
)
&&
(
nextBlockIndex
!=
BLOCK_UNUSED
))
(
nextBlockIndex
!=
BLOCK_UNUSED
))
{
{
StorageUtl_ReadDWord
(
depotBuffer
,
depotBlockOffset
,
&
nextBlockIndex
);
StorageUtl_ReadDWord
(
depotBuffer
,
depotBlockOffset
,
&
nextBlockIndex
);
if
(
nextBlockIndex
!=
BLOCK_UNUSED
)
if
(
nextBlockIndex
==
BLOCK_UNUSED
)
blockNoInSequence
++
;
{
freeBlock
=
(
depotIndex
*
blocksPerDepot
)
+
(
depotBlockOffset
/
sizeof
(
ULONG
));
}
depotBlockOffset
+=
sizeof
(
ULONG
);
depotBlockOffset
+=
sizeof
(
ULONG
);
}
}
...
@@ -2132,9 +2141,12 @@ ULONG StorageImpl_GetNextFreeBigBlock(
...
@@ -2132,9 +2141,12 @@ ULONG StorageImpl_GetNextFreeBigBlock(
}
}
depotIndex
++
;
depotIndex
++
;
depotBlockOffset
=
0
;
}
}
return
blockNoInSequence
;
This
->
prevFreeBlock
=
freeBlock
;
return
freeBlock
;
}
}
/******************************************************************************
/******************************************************************************
...
@@ -2309,6 +2321,9 @@ void StorageImpl_FreeBigBlock(
...
@@ -2309,6 +2321,9 @@ void StorageImpl_FreeBigBlock(
ULONG
blockIndex
)
ULONG
blockIndex
)
{
{
StorageImpl_SetNextBlockInChain
(
This
,
blockIndex
,
BLOCK_UNUSED
);
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
...
@@ -298,6 +298,7 @@ struct StorageImpl
ULONG
blockDepotCached
[
NUM_BLOCKS_PER_DEPOT_BLOCK
];
ULONG
blockDepotCached
[
NUM_BLOCKS_PER_DEPOT_BLOCK
];
ULONG
indexBlockDepotCached
;
ULONG
indexBlockDepotCached
;
ULONG
prevFreeBlock
;
/*
/*
* Abstraction of the big block chains for the chains of the header.
* 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