|
#define da_move(dst, src) \ |
|
do { \ |
|
free((dst)->items); \ |
|
(dst)->items = (src).items; \ |
|
(dst)->count = (src).count; \ |
|
(dst)->capacity = (src).capacity; \ |
|
} while (0) |
I think that we should "clear" src after moving it to dst (setting (src).items = NULL; and zeroing its count and capacity).
Since src still holds a pointer to items it could cause undesired side effects.
ded/src/common.h
Lines 37 to 43 in 57d23fa
I think that we should "clear"
srcafter moving it todst(setting(src).items = NULL;and zeroing itscountandcapacity).Since
srcstill holds a pointer toitemsit could cause undesired side effects.