3 ms·
But this entirely misses the "type safe" part...
by addaon 6y ago
But this entirely misses the "type safe" part...
- tom_mellior 6y agoMy understanding is that if you declare some_concrete_type *p; some_other_type x; then, for example, sbpush(p, x); will result in a type error as expected, since its core expands to: p[some_index] = x; So this is kind of type safe. There is an assumption that ((int *) <guaranteed aligned pointer>) + 2 will still be correctly aligned for any type. That's a pretty fair assumption on modern hardware, except maybe for SIMD types.