Add note about benchmarking.
[libguestfs-talks.git] / 2020-frama-c / 2810-range-init.html
1 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
2 <link rel="stylesheet" href="style.css" type="text/css"/>
3 <script src="code.js" type="text/javascript"></script>
4
5 <h1>qemu range_init_nofail()</h1>
6
7 <pre class="code">
8   /*
9    * Initialize range to span the interval [lob,lob + size - 1].
10    * size may be 0. Range must not overflow.
11    */
12   static inline void range_init_nofail(Range *range, uint64_t lob,
13                                        uint64_t size)
14   {
15       range->lob = lob;
16       range->upb = lob + size - 1;
17   }
18 </pre>
19 <pre>
20   lob == 0  size == 0
21   ┌─────────────────────────────────────────────────┐ 
22   │░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░│
23   └─────────────────────────────────────────────────┘
24 </pre>
25 <pre>
26   lob == 1  size == 0
27   ┌─────────────────────────────────────────────────┐ 
28   │ │                                               │
29   └─────────────────────────────────────────────────┘
30 </pre>