crash on my bad code

I’ve written two attempts at max externals, to calculate the cross product and dot product of 3-float-long lists (e.g. vectors). Well, they crash, and I’m sure it’s because a) my C is really rusty and b) this is my first attempt at writing externals. It’s probably due to bad allocation of memory with my structs and pointers, but the code is really very simple, so if someone has a minute to take a look at it and advise me, that’d be great. The end goal is to do a few more 3-vector and quarternion functions and opensource them.

FWIW,
If you don’t mind dependencies on Jitter, have a look at
jit.vecmath.h. There’s a world of vec3 and quat functions in there.
Haven’t taken a look at your code, so I don’t have any advice on that,
but the vector structs in vecmath are there for the borrowing if you
want to throw them in a max object and write your own
dot/crossproducts etc.

I think the problem is how I deal with the inlet proxy – I’m not sure I’m using it correctly. Glancing at the code for vexpr (because I want to be able to store a list in the 2nd inlet of my objects, without triggering a calculation) I did this:

No, this is wrong, since you’re not allocating x->c_proxy, but rather
declaring it as a variable, which is correct. You can just declare it
as "void *c_proxy" in your object struct, since it’s just a pointer.
Then, in new(),