Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
slash
Commits
d3a031ba
Unverified
Commit
d3a031ba
authored
Dec 26, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bitfs_reset()
parent
b81832bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
bitf_segmentation.h
src/bitf_segmentation.h
+11
-0
No files found.
src/bitf_segmentation.h
View file @
d3a031ba
...
...
@@ -42,6 +42,7 @@ struct bitfs {
#define BITFS_MAGIC 0xc18b98bd
uint16_t
nbitfss
;
// length of flexarray (used)
uint16_t
lbitfss
;
// space for flexarray
size_t
space
;
// for reset
size_t
nbits
;
size_t
nset
;
// count of set bits
struct
bitfss
s
[];
...
...
@@ -59,6 +60,7 @@ bitfs_init(void *p, size_t space)
memset
(
p
,
0
,
space
);
bitfs
=
p
;
bitfs
->
magic
=
BITFS_MAGIC
;
bitfs
->
space
=
space
;
space
-=
sizeof
*
bitfs
;
space
/=
sizeof
*
bitfs
->
s
;
...
...
@@ -71,6 +73,15 @@ bitfs_init(void *p, size_t space)
return
(
bitfs
);
}
static
inline
void
bitfs_reset
(
struct
bitfs
*
bitfs
)
{
CHECK_OBJ_NOTNULL
(
bitfs
,
BITFS_MAGIC
);
AN
(
bitfs
->
space
);
bitfs_init
(
bitfs
,
bitfs
->
space
);
}
static
inline
void
bitfs_add
(
struct
bitfs
*
bitfs
,
struct
bitf
*
bitf
)
{
...
...
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