postgres-extension 0.1.1

Write PostgreSQL extensions in rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

#[repr(C)]
pub struct MemoryContextData { _unused: [u8; 0] } // opaque

pub type MemoryContext = *mut MemoryContextData;

extern "C" {
    pub static CurrentMemoryContext: MemoryContext;
}

pub mod c {
    use crate::utils::memutils::*;
    extern "C" {
        pub fn MemoryContextAlloc(context: MemoryContext, size: usize) -> *mut u8;
        pub fn pfree(ptr: *mut u8) -> ();
    }
}