Hi, there

i prepared new Metacello configuration of NativeBoost.

Here the list of changes:


Integer>>#|  in AsmJit now

- added a recursion detecting/handling via notifications
- NBExternalHandle / NBExternalAddress is no longer subclasses of
NBExternalStructure
- more safer way to handle finalizing external objects survived from old session
- avoid recursion when printing external struct fields
- default alignment of external struct is machine word size
- correct padding between struct fields (need to test)
- ** fix ** conceptual bug when passing a struct by value. Now copying
its contents on stack, instead of passing pointer
- rewrote accessing struct fields, allowing nested structs
- added #size_t type and NBSizeT marshaller
- use stack pointer directly by getting it's address (via
stackPointerAddress() available in Cog), so accessing ST stack is
faster..
- added recursion guards in NBInterpreterProxy and in NBNativeCodeGen
to prevent runaway train(s)
- NBExternalType >> #typeSize answers the number of bytes which value
of full type (including ptr arity) variable takes place in memory.
NBExternalType >> valueSize is the number of bytes for base type
(excluding pointers) takes in memory.
NBExternalType >> stackSize taking into account stack argument alignment

-------------------------
The main change is handling correctly passing structs by value.
Before i was wrongly assuming that if function takes struct:

int foo ( struct x a)

you need to push the pointer to struct..
but in fact you need to copy struct contents on stack!

This means that all function signatures which were written based on
this wrong assumption should be changed to
pass a pointer (if function takes a pointer to struct).
So, don't be so haste to use it with Athens with new version of NB. It
will definitely break (and i know where) because of this mistake.
Fortunately, most of the libraries avoid passing structs by value, so
most of the bindings should still keep working fine after update.
But be warned about it!

Thanks Luc for pointing out on this issue.

Another improvement is because of more correct handling of structs,
now NB allows nested structs.

I blessed this version as #development.
If no serious bugs will be found, after testing it with Athens and
NBOpenGL (+ add your projects)
i will change blessing to #release.


-- 
Best regards,
Igor Stasenko.

Reply via email to