Skip to content

Instantly share code, notes, and snippets.

View rinon's full-sized avatar

Stephen Crane rinon

View GitHub Profile
@rinon
rinon / xmlmemory-after.rs
Created December 18, 2019 03:00
C2Rust header merging example
use crate::src::globals::{
__xmlGenericError, __xmlGenericErrorContext, xmlFree, xmlMalloc, xmlMallocAtomic, xmlMemStrdup,
xmlRealloc,
};
pub use crate::src::threads::{
xmlFreeMutex, xmlMutex, xmlMutexLock, xmlMutexPtr, xmlMutexUnlock, xmlNewMutex,
};
pub use crate::stddef_h::size_t;
pub use crate::stdlib::{
_IO_codecvt, _IO_lock_t, _IO_marker, _IO_wide_data, __off64_t, __off_t, FILE, _IO_FILE,

Keybase proof

I hereby claim:

  • I am rinon on github.
  • I am sjcrane (https://keybase.io/sjcrane) on keybase.
  • I have a public key ASBFpvzmDAiNsfPXRBQxkg3P_MDfJqaT_M4rg6YBGgmsVgo

To claim this, I am signing this object:

Vtable for 'A2' (3 entries).
0 | offset_to_top (0)
1 | A2 RTTI
-- (A2, 0) vtable address --
2 | XVTable Pointer 0
VTable indices for 'A2' (1 entries).
0 | void A2::f()
Vtable for 'V3' (3 entries).

Keybase proof

I hereby claim:

  • I am rinon on github.
  • I am sjcrane (https://keybase.io/sjcrane) on keybase.
  • I have a public key whose fingerprint is 6729 623B 591D 7621 9309 4327 11E4 4025 A1EF 536F

To claim this, I am signing this object:

extern console;
struct foo {
int x;
double y;
};
function bar(x) {
let foo* f = (foo*)(x);
console.log(f->x);