Differences From Artifact [a7eb89018c]:
- File src/bag.c — part of check-in [52b35c8b40] at 2014-01-27 09:05:45 on branch trunk — Remove unnecessary end-of-line spaces. (My editor does that automatically, but I don't want it to happen together with other functional changes in a single commit). No change in code. (user: jan.nijtmans size: 5298) [more...]
To Artifact [b200436ad8]:
- File src/bag.c — part of check-in [00e6d7997c] at 2019-12-20 00:12:19 on branch memleak-fixes — Various memleak fixes. Drops the reachable-at-exit memory of (fossil rebuild) on this repo from 45MB to 680kb. Added fossil_atexit_free_this() to allow us to clean up function-local static allocations. (user: stephan size: 5455)
| ︙ | |||
46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | + + + + + |
*/
struct Bag {
int cnt; /* Number of integers in the bag */
int sz; /* Number of slots in a[] */
int used; /* Number of used slots in a[] */
int *a; /* Hash table of integers that are in the bag */
};
/*
** An expression for statically initializing a Bag instance, to be
** assigned to Bag instances at their declaration point.
*/
#define Bag_INIT {0,0,0,0}
#endif
/*
** Initialize a Bag structure
*/
void bag_init(Bag *p){
memset(p, 0, sizeof(*p));
|
| ︙ |