… | |
… | |
59 | }; |
59 | }; |
60 | |
60 | |
61 | struct UUID |
61 | struct UUID |
62 | { |
62 | { |
63 | uint64 seq; |
63 | uint64 seq; |
|
|
64 | |
|
|
65 | UUID () { } |
|
|
66 | UUID (uint64 seq) : seq(seq) { } |
|
|
67 | operator uint64() { return seq; } |
|
|
68 | void operator =(uint64 seq) { this->seq = seq; } |
64 | }; |
69 | }; |
65 | |
70 | |
66 | extern void init_uuid (); |
71 | extern void init_uuid (); |
67 | extern UUID gen_uuid (); |
72 | extern UUID gen_uuid (); |
68 | extern const uint64 UUID_SKIP; |
73 | extern const uint64 UUID_SKIP; |
… | |
… | |
255 | static bool can_merge_slow (object *op1, object *op2); |
260 | static bool can_merge_slow (object *op1, object *op2); |
256 | |
261 | |
257 | // this is often used in time-critical code, so optimise |
262 | // this is often used in time-critical code, so optimise |
258 | static bool can_merge (object *op1, object *op2) |
263 | static bool can_merge (object *op1, object *op2) |
259 | { |
264 | { |
260 | return op1->value != op2->value |
265 | return op1->value == op2->value |
261 | && op1->name != op2->name |
266 | && op1->name == op2->name |
262 | && can_merge_slow (op1, op2); |
267 | && can_merge_slow (op1, op2); |
263 | } |
268 | } |
264 | |
269 | |
265 | void clear (); |
270 | void clear (); |
266 | |
271 | |