Skip to content

Commit

Permalink
Bikeshed pgrx::mem to pgrx::memcx
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Dec 6, 2023
1 parent 556d2dc commit dd422ae
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pgrx/src/fn_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use pgrx_pg_sys::ffi::pg_guard_ffi_boundary;
use pgrx_pg_sys::PgTryBuilder;
use std::panic::AssertUnwindSafe;

use crate::mem;
use crate::memcx;
use crate::pg_catalog::pg_proc::{PgProc, ProArgMode, ProKind};
use crate::seal::Sealed;
use crate::{
Expand Down Expand Up @@ -333,7 +333,7 @@ fn lookup_fn(fname: &str, args: &[&dyn FnCallArg]) -> Result<pg_sys::Oid> {
// function following the normal SEARCH_PATH rules, ensuring its argument type Oids
// exactly match the ones from the user's input arguments. It does not evaluate the
// return type, so we'll have to do that later
mem::current_context(|mcx| {
memcx::current_context(|mcx| {
let mut parts_list = List::<*mut std::ffi::c_void>::default();
let result = PgTryBuilder::new(AssertUnwindSafe(|| unsafe {
let arg_types = args.iter().map(|a| a.type_oid()).collect::<Vec<_>>();
Expand Down Expand Up @@ -439,7 +439,7 @@ fn create_default_value(pg_proc: &PgProc, argnum: usize) -> Result<Option<pg_sys
}

let default_argnum = argnum - non_default_args_cnt;
let node = mem::current_context(|mcx| {
let node = memcx::current_context(|mcx| {
let default_value_tree =
pg_proc.proargdefaults(mcx).ok_or(FnCallError::NoDefaultArguments)?;
default_value_tree
Expand Down
2 changes: 1 addition & 1 deletion pgrx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub mod itemptr;
pub mod iter;
pub mod list;
pub mod lwlock;
pub mod mem;
pub mod memcx;
pub mod memcxt;
pub mod misc;
#[cfg(feature = "cshim")]
Expand Down
2 changes: 1 addition & 1 deletion pgrx/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! It functions similarly to a Rust [`Vec`], including iterator support, but provides separate
//! understandings of [`List`][crate::pg_sys::List]s of [`pg_sys::Oid`]s, Integers, and Pointers.

use crate::mem::MemCx;
use crate::memcx::MemCx;
use crate::pg_sys;
use crate::seal::Sealed;
use core::marker::PhantomData;
Expand Down
2 changes: 1 addition & 1 deletion pgrx/src/list/flat_list.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{Enlist, List, ListCell, ListHead};
use crate::mem::MemCx;
use crate::memcx::MemCx;
use crate::pg_sys;
use crate::seal::Sealed;
use core::cmp;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pgrx/src/pg_catalog/pg_proc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//LICENSE
//LICENSE Use of this source code is governed by the MIT license that can be found in the LICENSE file.
use crate::list::List;
use crate::mem::MemCx;
use crate::memcx::MemCx;
use crate::{pg_sys, FromDatum, IntoDatum};
use std::ptr::NonNull;

Expand Down
4 changes: 2 additions & 2 deletions pgrx/src/pg_sys.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! dirty hacks

// Flatten out the contents into here.
use crate::mem;
use crate::memcx;
pub use pgrx_pg_sys::*;

// Interposing here can allow extensions like ZomboDB to skip the cshim,
Expand All @@ -15,7 +15,7 @@ pub use pgrx_pg_sys::*;
*/
#[inline]
pub unsafe fn rt_fetch(index: Index, range_table: *mut List) -> *mut RangeTblEntry {
mem::current_context(|cx| {
memcx::current_context(|cx| {
crate::list::List::<*mut core::ffi::c_void>::downcast_ptr_in_memcx(range_table, cx)
.expect("rt_fetch used on non-ptr List")
.get((index - 1) as _)
Expand Down

0 comments on commit dd422ae

Please sign in to comment.