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 2:58

>>12
[2]: no overflow checking functions

Because not every architecture has a flags register.

other kind of unsafe functions (like atoi, shit like strftime)

All shit yes; but too old and widely used to remove at this point.

lack of ssize_t (that can hold everything size_t can + atleast 1 bit)

Not possible unless you're comfortable with having sizeof(size_t) != sizeof(ssize_t).

lack of [s]size_t function that can hold the maximum value of size_t * CHAR_BIT

And this is useful because you address bits when?

intptr_t/uintptr_t are optional and

Because not all architectures interpret integers as pointers into a flat address space.

lack of a byte type that is atleast 1 bit instead of char (char is atleast 8 bit and can be more even if you have 8-bit bytes if the encoding is more than 8 bit)

That's what int is for.

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