Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How To Implement Closures?

Name: Anonymous 2014-06-11 16:44

As I understand, closures could be unboxed using a generated trampoline, like
mov rax, qword 12345678ABCDEFh ; 10 bytes function address
jmp rax ; 2 bytes
payload times N db 0 ; closure environment


Won't that mess code cache?

Name: Anonymous 2014-06-12 4:22

many times for example if you want to create a array of char, int or anything that you access it per bit

And the arrays you are accessing can be up to 1 / CHAR_BIT of your address space? Just typedef unsigned long bit_size_t and be done with it.

I did not have them in my mind for usage of them as pointers but for being able to do things like counting the items of a linked list, a type that can hold all the possible addresses would be the only one that for sure would be able to fit the maximum number

That's exactly what size_t is supposed to be for.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List