Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc7e5e99

Browse files
committed
Fix REALLOCATE_BITMAPSETS code
7d58f23 added a compile-time option to have bitmapset.c reallocate theset before returning when a set is modified. That commit failed to doits job in various cases and returned the input set when it shouldn'thave in these cases. Here we fix those missing cases.This commit also adds some documentation about whatREALLOCATE_BITMAPSETS is for. This is important as future functionsthat go inside bitmapset.c need to know if they need to do anythingspecial when this compile-time option is defined.Also, between71a3e8c and7d58f23 some Asserts seem to have becomeduplicated. Tidy these up. Rather than having the Assert check eachaspect of what makes a set invalid, here we introduce a helper functionwhich returns false when a set is invalid and have the Asserts use thisinstead.Also, make a pass on improving the comments in bitmapset.c. Variouscomments mentioned the input sets being "recycled". This could beinterpreted to mean that the output set will always point to the samememory as the given input parameter. Here we try to make it clear thatthis must not be relied upon and that callers must ensure that allreferences to a given set are updated on each modification.In passing, improve comments for bms_union(), bms_intersect() andbms_difference() to detail what they do. I (David) have too often had toremind myself by reading the code each time to find out if I need, forexample, to use bms_union() or bms_join(). I also removed somelow-value comments that were trying to convey information about "theseoperations" without mentioning which operations it was talking about.It seems better to document these things in the function header commentinstead.Author: Richard Guo, David RowleyDiscussion:https://postgr.es/m/CAMbWs4-djy9qYux2gZrtmxA0StrYXJjvB-oqLxn-d7J88t=PQQ@mail.gmail.com
1 parent45d395c commitc7e5e99

File tree

1 file changed

+189
-140
lines changed

1 file changed

+189
-140
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp