annotate anagram/ag1/cppalloc.cpp @ 21:1c9dac05d040

Add lint-style FALLTHROUGH annotations to fallthrough cases. (in the parse engine and thus the output code) Document this, because the old output causes warnings with gcc10.
author David A. Holland
date Mon, 13 Jun 2022 00:04:38 -0400
parents 7661c1604e49
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
1 #include <stddef.h>
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
2 #include "port.h"
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
3
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
4 #include "myalloc.h"
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
5
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
6 /*
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
7 * With the IBM compiler these apparently may not be in a .lib file.
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
8 */
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
9
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
10 void *operator new(size_t size) {
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
11 //newCalls++;
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
12 void *pointer = myalloc(size);
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
13 return pointer;
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
14 }
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
15
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
16 void operator delete(void *p) {
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
17 //deleteCalls++;
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
18 DEALLOCATE(p);
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
19 }
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
20
5
7661c1604e49 Add additional operator delete calls gcc 10 asked for.
David A. Holland
parents: 0
diff changeset
21 void operator delete(void *p, size_t) {
7661c1604e49 Add additional operator delete calls gcc 10 asked for.
David A. Holland
parents: 0
diff changeset
22 //deleteCalls++;
7661c1604e49 Add additional operator delete calls gcc 10 asked for.
David A. Holland
parents: 0
diff changeset
23 DEALLOCATE(p);
7661c1604e49 Add additional operator delete calls gcc 10 asked for.
David A. Holland
parents: 0
diff changeset
24 }
7661c1604e49 Add additional operator delete calls gcc 10 asked for.
David A. Holland
parents: 0
diff changeset
25
0
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
26 void *operator new[](size_t size) {
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
27 //newArrayCalls++;
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
28 void *pointer = myalloc(size);
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
29 return pointer;
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
30 }
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
31
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
32 void operator delete[](void *p) {
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
33 //deleteArrayCalls++;
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
34 DEALLOCATE(p);
13d2b8934445 Import AnaGram (near-)release tree into Mercurial.
David A. Holland
parents:
diff changeset
35 }
5
7661c1604e49 Add additional operator delete calls gcc 10 asked for.
David A. Holland
parents: 0
diff changeset
36
7661c1604e49 Add additional operator delete calls gcc 10 asked for.
David A. Holland
parents: 0
diff changeset
37 void operator delete[](void *p, size_t) {
7661c1604e49 Add additional operator delete calls gcc 10 asked for.
David A. Holland
parents: 0
diff changeset
38 //deleteArrayCalls++;
7661c1604e49 Add additional operator delete calls gcc 10 asked for.
David A. Holland
parents: 0
diff changeset
39 DEALLOCATE(p);
7661c1604e49 Add additional operator delete calls gcc 10 asked for.
David A. Holland
parents: 0
diff changeset
40 }