Benjamin Bannier
26d04fd9fc
Bump pre-commit hooks
2023-10-30 09:41:12 +01:00
Benjamin Bannier
f5a76c1aed
Reformat Zeek in Spicy style
...
This largely copies over Spicy's `.clang-format` configuration file. The
one place where we deviate is header include order since Zeek depends on
headers being included in a certain order.
2023-10-30 09:40:55 +01:00
Tim Wojtulewicz
4229af6820
Remove deprecations tagged for v6.1
2023-06-14 10:07:22 -07:00
Tim Wojtulewicz
35ee96c4cb
A bunch of other minor issues reported by PVS-Studio
2023-01-27 13:03:52 -07:00
Tim Wojtulewicz
34f7c95a51
Add missing assignment operators to RobustDictIterator
2023-01-27 13:03:52 -07:00
Tim Wojtulewicz
797b7657f5
Fix sprintf warnings on macOS
...
The most recent compiler update for macOS marked sprintf as
deprecated, so we started getting warnings from all of the places
that use it.
2023-01-03 12:14:41 -07:00
Tim Wojtulewicz
2739275b88
Merge remote-tracking branch 'jsoref/spelling-src'
...
* jsoref/spelling-src:
Spelling src
2022-11-11 12:49:15 -07:00
Josh Soref
cd201aa24e
Spelling src
...
These are non-functional changes.
* accounting
* activation
* actual
* added
* addresult
* aggregable
* aligned
* alternatively
* ambiguous
* analysis
* analyzer
* anticlimactic
* apparently
* application
* appropriate
* arithmetic
* assignment
* assigns
* associated
* authentication
* authoritative
* barrier
* boundary
* broccoli
* buffering
* caching
* called
* canonicalized
* capturing
* certificates
* ciphersuite
* columns
* communication
* comparison
* comparisons
* compilation
* component
* concatenating
* concatenation
* connection
* convenience
* correctly
* corresponding
* could
* counting
* data
* declared
* decryption
* defining
* dependent
* deprecated
* detached
* dictionary
* directional
* directly
* directory
* discarding
* disconnecting
* distinguishes
* documentation
* elsewhere
* emitted
* empty
* endianness
* endpoint
* enumerator
* essentially
* evaluated
* everything
* exactly
* execute
* explicit
* expressions
* facilitates
* fiddling
* filesystem
* flag
* flagged
* for
* fragments
* guarantee
* guaranteed
* happen
* happening
* hemisphere
* identifier
* identifies
* identify
* implementation
* implemented
* implementing
* including
* inconsistency
* indeterminate
* indices
* individual
* information
* initial
* initialization
* initialize
* initialized
* initializes
* instantiate
* instantiated
* instantiates
* interface
* internal
* interpreted
* interpreter
* into
* it
* iterators
* length
* likely
* log
* longer
* mainly
* mark
* maximum
* message
* minimum
* module
* must
* name
* namespace
* necessary
* nonexistent
* not
* notifications
* notifier
* number
* objects
* occurred
* operations
* original
* otherwise
* output
* overridden
* override
* overriding
* overwriting
* ownership
* parameters
* particular
* payload
* persistent
* potential
* precision
* preexisting
* preservation
* preserved
* primarily
* probably
* procedure
* proceed
* process
* processed
* processes
* processing
* propagate
* propagated
* prototype
* provides
* publishing
* purposes
* queue
* reached
* reason
* reassem
* reassemble
* reassembler
* recommend
* record
* reduction
* reference
* regularly
* representation
* request
* reserved
* retrieve
* returning
* separate
* should
* shouldn't
* significant
* signing
* simplified
* simultaneously
* single
* somebody
* sources
* specific
* specification
* specified
* specifies
* specify
* statement
* subdirectories
* succeeded
* successful
* successfully
* supplied
* synchronization
* tag
* temporarily
* terminating
* that
* the
* transmitted
* true
* truncated
* try
* understand
* unescaped
* unforwarding
* unknown
* unknowndata
* unspecified
* update
* usually
* which
* wildcard
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-11-09 12:08:15 -05:00
Tim Wojtulewicz
557ffe7bbc
Report an error if a key is too big for a DictEntry
2022-11-08 16:44:29 -07:00
Tim Wojtulewicz
d19478f49f
Use larger size variable for DictEntry key_size to avoid overflows with big keys
2022-11-08 16:44:29 -07:00
Tim Wojtulewicz
2159df41cb
Merge remote-tracking branch 'jasonlue/topic/jasonlu/dict-clone-performance'
...
* jasonlue/topic/jasonlu/dict-clone-performance:
reset performance metrics every SizeUp()
reduce space_distance_samples from int64_6 to uint32_t
add performance based growth strategy
2022-10-18 08:53:38 -07:00
Jason Lu
bf2896f33c
reset performance metrics every SizeUp()
2022-10-14 09:55:36 -07:00
Jason Lu
a716d766a9
reduce space_distance_samples from int64_6 to uint32_t
2022-10-14 09:43:41 -07:00
jasonlue
6c052bf926
Merge branch 'zeek:master' into topic/jasonlu/dict-clone-performance
2022-10-13 11:41:50 -07:00
Jason Lu
967119e981
add performance based growth strategy
2022-10-12 12:17:29 -07:00
Tim Wojtulewicz
20292b0210
Disable robust iteration for ordered dictionaries
...
This also includes some minor commenting cleanup in that class
2022-10-10 10:08:58 -07:00
Tim Wojtulewicz
57ae03dd7d
Add support for itertors with ordered dictionaries
2022-10-10 10:08:58 -07:00
Tim Wojtulewicz
f2ae1da764
Dict: Mark iterator move operator/constructors as noexcept
2022-09-20 13:04:19 -07:00
Tim Wojtulewicz
1befb9ba6f
Dict: Reduce some math required in repeatedly-called functions
2022-09-20 13:04:04 -07:00
Tim Wojtulewicz
25a280d6a1
Dict: use std::log2, remove custom Log2 method
2022-09-20 13:03:50 -07:00
Tim Wojtulewicz
49a1dc8a40
Turn PDict into a type alias
2022-07-05 13:33:34 -07:00
Tim Wojtulewicz
47e7fe2cd1
Convert Dictionary types to be templated classes
...
This has the fortunate side-effect of also making it so we can store
the value objects as typed pointers, instead of void*.
2022-07-05 13:33:34 -07:00
Tim Wojtulewicz
392c2f3810
Remove deprecated IterCookie-based dictionary iteration
2022-06-30 19:06:01 +00:00
Tim Wojtulewicz
70e63d4749
Remove deprecated MemoryAllocation() methods and related code
2022-06-30 18:56:52 +00:00
Tim Wojtulewicz
93ee353f30
Add const versions of dereference operators for DictEntry
2022-04-22 13:10:31 -07:00
Tim Wojtulewicz
64748edab1
Replace most uses of typedef with using for type aliasing
2021-10-11 14:51:10 -07:00
Tim Wojtulewicz
b2f171ec69
Reformat the world
2021-09-16 15:35:39 -07:00
Vern Paxson
9f68002392
factoring to support debugging of Dict iterators - no semantic changes
2021-09-08 10:23:38 -07:00
Tim Wojtulewicz
a7fd34375f
GH-572: Mark MemoryAllocation() and related methods deprecated
2021-06-28 11:07:58 -07:00
Tim Wojtulewicz
c56fb3e8e4
Move building session analyzer tree out of analyzer::Manager
2021-05-18 11:52:04 -07:00
Tim Wojtulewicz
6ab317f7bd
GH-1546: Make DictIterator() public, add copy/move operators
2021-05-17 11:57:17 -07:00
Tim Wojtulewicz
4ad08172d0
Remove obsolete ZEEK_FORWARD_DECLARE_NAMESPACED macros
2021-02-24 14:35:44 -07:00
Tim Wojtulewicz
0618be792f
Remove all of the random single-file deprecations
...
These are the changes that don't require a ton of changes to other files outside
of the original removal.
2021-01-27 10:52:40 -07:00
Jon Siwek
bd0c1bcde7
Merge remote-tracking branch 'origin/topic/timw/dict-iterators'
...
* origin/topic/timw/dict-iterators:
Implement standard-library-compatible iterators for Dictionary
2021-01-14 19:31:17 -08:00
Tim Wojtulewicz
892124378c
Implement standard-library-compatible iterators for Dictionary
2021-01-14 13:49:40 -07:00
Jon Siwek
8f98b068c8
GH-1328: Improve behavior of Dictionary iterator invalidation
...
Previously, an assertion was triggered in debug builds upon any attempt
to insert or remove a Dictionary entry while any iteration of that
Dictionary is underway and also even in cases where Dictionary membership
was not actually modified (and thus invalidates a loop).
Now, it emits run-time warnings regardless of build-type and only when
insert/remove operations truly change the Dictionary membership. In the
context of a Zeek script causing an invalidation, the warning message
also now helps pinpoint the exact expression that causes it.
2020-12-11 18:52:31 -08:00
Tim Wojtulewicz
96d9115360
GH-1079: Use full paths starting with zeek/ when including files
2020-11-12 12:15:26 -07:00
Tim Wojtulewicz
fe0c22c789
Base: Clean up explicit uses of namespaces in places where they're not necessary.
...
This commit covers all of the common and base classes.
2020-08-24 12:07:00 -07:00
Tim Wojtulewicz
47f3eb69fa
Move Dict constants to detail namespace
2020-08-11 11:26:22 -07:00
Tim Wojtulewicz
c795f2014f
Add a few missing deprecation fixes
2020-08-11 11:26:22 -07:00
Jon Siwek
ba1611c21f
Adjust Dict whitespace/style
2020-08-11 11:26:22 -07:00
Jon Siwek
37d3cfbd44
Fix new/malloc/delete/free mismatches in Dictionary code
2020-08-11 11:26:21 -07:00
Tim Wojtulewicz
0c7e4d62ee
Overwrite old Dict.h/cc with new ones
2020-08-11 11:26:21 -07:00
jasonlue
d3eeeb0f4c
add Clustered Hashing based Open Addressing Dict. To replace the existing dict, #define USE_OPEN_DICT
2020-08-11 11:26:21 -07:00
Tim Wojtulewicz
a243c0e4a6
Overwrite old Dict.h/cc with new ones
2020-08-09 21:27:23 -07:00
jasonlue
19f063f2a3
add Clustered Hashing based Open Addressing Dict. To replace the existing dict, #define USE_OPEN_DICT
2020-08-09 21:12:19 -07:00
Tim Wojtulewicz
a2a435360a
Move all of the hashing classes/functions to zeek::detail namespace
2020-07-31 16:23:34 -04:00
Tim Wojtulewicz
464efbe66a
Move Dictionary/PDict, List/PList, and Queue/PQueue to zeek namespace
2020-06-30 21:12:26 -07:00
Jon Siwek
3f92df51b7
Improve TableVal HashKey management
...
* Deprecated ComputeHash() methods and replaced with MakeHashKey()
which returns std::unique_ptr<HashKey>
* Deprecated RecoverIndex() and replaced with RecreateIndex()
which takes HashKey& and returns IntrusivePtr.
* Updated the new TableVal Assign()/Remove() methods to take either
std::unique_ptr<HashKey> or HashKey& as appropriate for clarity of
ownership expectations.
2020-05-20 22:16:47 -07:00
Johanna Amann
a3a38f0849
Merge remote-tracking branch 'origin/topic/timw/nullptr'
...
* origin/topic/timw/nullptr:
The remaining nulls
plugin/probabilistic/zeekygen: Replace nulls with nullptr
file_analysis: Replace nulls with nullptr
analyzer: Replace nulls with nullptr
iosource/threading/input/logging: Replace nulls with nullptr
2020-04-09 08:59:53 -07:00