Skip to content

Commit 1d1784c

Browse files
authored
Update 2025-11-30-comptime-c-functions.md
1 parent 829f858 commit 1d1784c

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

_posts/2025-11-30-comptime-c-functions.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ int main(void) {
126126
127127
Clang requires `-O2`, while GCC requires `-O3`.
128128
129-
Copy of the code on [Compiler Explorer](https://godbolt.org/z/Yjz9n5bnM):
129+
Copy of the code on [Compiler Explorer](https://godbolt.org/z/d176e16eb):
130130
131131
```c
132132
#include <assert.h>
@@ -138,7 +138,7 @@ Copy of the code on [Compiler Explorer](https://godbolt.org/z/Yjz9n5bnM):
138138
139139
typedef struct {
140140
bool occupied;
141-
unsigned char key_value[];
141+
unsigned char key_value[]; // C99 flexible array member
142142
} entry;
143143
144144
typedef struct {
@@ -156,6 +156,7 @@ static inline void hashmap_init(hashmap *m, void *buf, size_t ks, size_t vs, siz
156156
memset(buf, 0, cap * m->entry_size);
157157
}
158158
159+
// Naive hashing
159160
__attribute__((always_inline))
160161
static inline size_t hash(const void *key, size_t size) {
161162
size_t h = 0;

0 commit comments

Comments
 (0)