-
Notifications
You must be signed in to change notification settings - Fork 3
Prefetch manage #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
EtiShkol
wants to merge
4
commits into
team_Storage
Choose a base branch
from
PrefetchManage
base: team_Storage
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Prefetch manage #59
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| #pragma once | ||
| #include <stdbool.h> | ||
| #include <stdlib.h> // For malloc, free | ||
| #define MAX_SUPPORTED_PARALLEL_RANGE 4 | ||
| #define SUPPORTED_RANGE_LENGTH 1 | ||
| #define SUPPORTED_RANGE_WIDTH 1 | ||
| #define INIT_COUNTER 2 | ||
| #define SIZE_OF_ENOUGH_SEQ 3 | ||
| #define INIT_POINT_VALUE { -1,-1 } | ||
| #define COUNT_OF_RANGE_TO_READING_AHEAD 2 | ||
| #define INIT_RANGE_VALUE {INIT_POINT_VALUE,INIT_POINT_VALUE} | ||
|
|
||
| //struct that representing a point in a plane | ||
| typedef struct Point_s | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove spaces
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
| { | ||
| int x; | ||
| int y; | ||
| }Point_t; | ||
|
|
||
| //struct that representing range of two points in a plane, bottom-right and top-left | ||
| typedef struct Range_s | ||
| { | ||
| Point_t bottomRight; | ||
| Point_t topLeft; | ||
| }Range_t; | ||
|
|
||
| //enum of the optional direction of sequences | ||
| typedef enum Range_Direction_e { | ||
| RIGHT, | ||
| LEFT, | ||
| UP, | ||
| DOWN, | ||
| IN_VALID_DIR | ||
| }Range_Direction_t; | ||
|
|
||
| //enum of optional types of action in the insert function | ||
| typedef enum INSERT_ACTION_TYPE_e { | ||
| CONTINUE_SEQ, | ||
| CREATE_SEQ, | ||
| INSERT_TO_SINGLE_RANGES_ARRAY | ||
| }INSERT_ACTION_TYPE_t; | ||
|
|
||
| //struct that representing information of sequence | ||
| typedef struct SeqRangeInfo_s | ||
| { | ||
| Range_t lastInsertedRange; | ||
| Range_t nextExpectedRange; | ||
| Range_Direction_t dir; | ||
| int counterUse; | ||
| int counter; | ||
| }SeqRangeInfo_t; | ||
|
|
||
| typedef struct CyclicArray_s { | ||
| Range_t array[MAX_SUPPORTED_PARALLEL_RANGE]; | ||
| int index; | ||
| }CyclicArray_t; | ||
|
|
||
| //control block of the program | ||
| typedef struct SequenceCollectionCtrlBlk_s { | ||
| SeqRangeInfo_t* seqRangeInfoArray[MAX_SUPPORTED_PARALLEL_RANGE]; | ||
| CyclicArray_t singleRangesArray; | ||
| Range_t RangesInLoadingArray[MAX_SUPPORTED_PARALLEL_RANGE]; | ||
| }SequenceCollectionCtrlBlk_t; | ||
|
|
||
| #pragma region Range Functions | ||
|
|
||
| //function init the range | ||
| Range_t GetDefaultRange(void); | ||
|
|
||
| //function get direction, range and num, and return the next range by the direction, double the num | ||
| Range_t GetNextRangeByDirection(Range_t range, Range_Direction_t dir); | ||
|
|
||
| bool IsEqualRanges(Range_t me, Range_t other); | ||
|
|
||
| //function check if currentSmallRange contained in containRange | ||
| bool IsRangeContainedInOtherRange(Range_t currentSmallRange, Range_t containRange); | ||
|
|
||
| //function check if new range complete the last inserted range to sequence by some direction, if true it return the direction | ||
| Range_Direction_t IsRangeCompleteSingleRangeToSequence(Range_t range, Range_t singleRange); | ||
|
|
||
| #pragma endregion | ||
|
|
||
| #pragma region SequenceCollectionCtrlBlk Functions | ||
|
|
||
| //function return the index to override by LRU | ||
| int GetLastUsedSequence(void); | ||
|
|
||
| //internal function called by the external function-InsertNewRangeAPI | ||
| INSERT_ACTION_TYPE_t InsertNewRange(Range_t range); | ||
|
|
||
| //function of Reading ahead when the seq is enough | ||
| void ReadingAhead(SeqRangeInfo_t* seq); | ||
|
|
||
| //function of check if the new range continue some exist seq, and return the index of the found seq | ||
| int IsRangeContinueSequence(Range_t range); | ||
|
|
||
| //function of check if the new range create new seq with single range from singleRangesArray | ||
| int IsRangeCreateNewSequence(Range_t range); | ||
|
|
||
| //function of get index of seq that update now and up the counter use of the others seqs | ||
| void IncreaseAllLRUCountersExceptSpecificCounter(int index); | ||
| #pragma endregion | ||
|
|
||
| #pragma region RangesInLoadingArray Functions | ||
|
|
||
| //function return the index of the empty place of loadingArray | ||
| int GetNextEmptyIndexOfRangesInLoadingArray(void); | ||
|
|
||
|
|
||
| //function find the index of range in loadingArray | ||
| int FindRangeInLoadingRangesArray(Range_t rangeForRemove); | ||
|
|
||
| //function get range and add it to the loadingArray | ||
| void AddRangeToLoadingRangeArray(Range_t rangeForAdd); | ||
|
|
||
| bool CheckValidationOfRange(Range_t range); | ||
| #pragma endregion | ||
|
|
||
| void PrintCurrentTimeToErrorFile(void); | ||
|
|
||
| void FetchFromDisk(Range_t range); | ||
| //void Test(void); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #pragma once | ||
|
|
||
| //function that get range and check if its in loading | ||
| bool Prefetch_IsRangeInLoading(Range_t rangeForSearch); | ||
|
|
||
| //function that get range to remove, find it and delete it from loadingArray | ||
| void Prefetch_RemoveRangeFromLoadingRanges(Range_t rangeForRemove); | ||
|
|
||
| //external function of insert new range | ||
| void Prefetch_InsertNewRange(Range_t range); | ||
|
|
||
| void Prefetch_INIT(void); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
|
|
||
| Failed to allocate memory for Sequence Pointer - - - The current time is: 13:15:55 | ||
| The range to found is not valid - - - The current time is: 17:33:06 | ||
| The range to found is not valid - - - The current time is: 17:35:12 | ||
| The range to found is not valid - - - The current time is: 17:36:14 | ||
| The range to found is not valid - - - The current time is: 17:39:46 | ||
| The range to found is not valid - - - The current time is: 17:43:04 | ||
| The range to found is not valid - - - The current time is: 17:43:04 | ||
| The range to found is not valid - - - The current time is: 17:43:04 | ||
| The range to found is not valid - - - The current time is: 17:44:25 | ||
| The range to found is not valid - - - The current time is: 17:44:25 | ||
| The range to found is not valid - - - The current time is: 17:44:25 | ||
| The range to found is not valid - - - The current time is: 17:45:02 | ||
| The range to found is not valid - - - The current time is: 17:45:02 | ||
| The range to found is not valid - - - The current time is: 17:45:02 | ||
| The inserted range is not valid - - - The current time is: 12:08:27 | ||
| The inserted range is not valid - - - The current time is: 12:13:29 | ||
| The inserted range is not valid - - - The current time is: 12:13:29 | ||
| The inserted range is not valid - - - The current date and time is: 2024-07-29 12:16:48 | ||
| The inserted range is not valid - - - The current date and time is: 2024-07-29 12:16:48 | ||
| The inserted range is not valid - - - The current date and time is: 2024-07-29 13:10:23 | ||
| The inserted range is not valid - - - The current date and time is: 2024-07-29 13:10:23 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:19:08 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:19:08 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:38:50 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:38:50 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:47:07 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:47:07 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:49:09 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:49:09 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:51:02 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:51:02 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:54:08 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:54:08 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:58:40 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 10:58:40 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 11:04:57 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 11:04:57 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 11:08:45 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 11:08:45 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 11:55:25 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 11:55:25 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 11:57:33 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 11:57:33 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:00:03 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:00:03 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:03:46 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:03:46 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:07:12 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:07:12 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:08:47 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:08:47 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:13:56 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:13:56 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:24:42 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:24:42 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:24:42 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:24:42 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:32:17 | ||
| The inserted range is not valid - - - The current date and time is: 2024-09-15 12:32:17 |
Binary file added
BIN
+316 Bytes
Storage/.vs/Storage/FileContentIndex/8d8b4053-de17-436d-b9e4-2fe3f0ebdc18.vsidx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?