Repository navigation
Conversation
763e17e to
095445d
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. Walkthrough
Change: Refactor Merge Risk:
|
095445d to
ddc2ecc
Compare
ddc2ecc to
9fdc776
Compare
9fdc776 to
006c2e4
Compare
8064f6d to
9f9a76f
Compare
4214d14 to
b8a434e
Compare
b8a434e to
ceb5cfd
Compare
An Action or CHB over an empty array keeps its shared storage, so it stays initialized with size zero, copyable, and an empty Action still accepts a decay change. It no longer requests or frees a zero-size element buffer and no longer posts a recorder propagator. Zdev-Change-Id: Zd4e6b819bd4f6bcd64b83d6fcd1a94d1bdf26ec1dc2e580c53e90ed98a16a1c9
TupleSet, Archive, Space::rrealloc, the FlatZinc set and regular builtins, the example dictionary, DFA and TupleSet construction from a DFA, and IntSet initializer lists no longer request zero bytes from the heap or a region and no longer pass null pointers to memcpy. Buffers that can now be null are freed only when non-null. An empty initializer list gives the empty IntSet, and a FlatZinc regular constraint with a reversed final-state range treats it as empty. Zdev-Change-Id: Z739fba34334ff1732238cd5ef32e1903b009ce0fe1dcc1ec967ee3213b53009f
Heap requests now document that allocation sizes are positive, that realloc may grow from zero elements, and that copy needs non-null pointers even for zero elements. Debug builds assert a positive size in Heap::ralloc and rrealloc, and rrealloc no longer accepts zero. Two lint findings are fixed: an intentional copy in the branch tests gets a NOLINT, and an assert in TupleSet finalization documents a count that clang-analyzer cannot follow. Zdev-Change-Id: Z56a1f083f220acb099fd0bc9a9ac161b74b110451fa021068f6b7b92b1e3acca
ceb5cfd to
65712d2
Compare
Across several modules, Gecode still requested zero bytes from the heap or a region, or passed null pointers with a zero element count to
memcpy. What a zero-byte allocation returns is implementation-defined, and passing a null pointer tomemcpyis undefined behavior in C and C++ even when the length is zero.This PR removes the remaining zero-size requests and null-pointer copies, then makes the heap contract explicit:
ActionorCHBcreated over an empty array keeps its shared storage so it remains initialized with size zero, copyable, and (forAction) still accepts decay updates, but it no longer allocates a zero-size element buffer or posts a recorder propagator.TupleSet,Archive,Space::rrealloc, the FlatZinc set and regular builtins, the example dictionary, DFA andTupleSet-from-DFA construction, andIntSetinitializer lists no longer make zero-byte requests or pass null pointers tomemcpy. Buffers that can now stay null are freed only when non-null; an empty initializer list constructs an emptyIntSet, and a FlatZincregularconstraint with a reversed final-state range treats the range as empty.Heapnow documents its size contract: allocation sizes must be positive,reallocmay grow from zero elements (whilerreallocno longer accepts zero), andcopyrequires non-null pointers even for zero elements. Debug builds assert the positive-size precondition inHeap::rallocandHeap::rrealloc.Stack
Merge in this order. #242, #282, #283, #241, #284, and #285 are merged. #286 targets
main, and each later PR builds on the one before it so its diff shows only its own commits. The first four PRs are standalone search and random-number changes; #284 through #274 are the Gecode 7 changes split out of what used to be a single branch.Summary by CodeRabbit