From 7fe4d946ddcfae7cd0a64b9f037947b8442296e0 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Mon, 13 Jan 2020 12:49:06 -0500 Subject: [PATCH] Make HaspMap and RawTable to be repr(C) --- src/map.rs | 1 + src/raw/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/map.rs b/src/map.rs index 5bb4a9d358..18c2b46d3b 100644 --- a/src/map.rs +++ b/src/map.rs @@ -190,6 +190,7 @@ pub enum DefaultHashBuilder {} /// // use the values stored in map /// } /// ``` +#[repr(C)] #[derive(Clone)] pub struct HashMap { pub(crate) hash_builder: S, diff --git a/src/raw/mod.rs b/src/raw/mod.rs index 1a04b9ac1f..c105c5a1ce 100644 --- a/src/raw/mod.rs +++ b/src/raw/mod.rs @@ -329,6 +329,7 @@ impl Bucket { } /// A raw hash table with an unsafe API. +#[repr(C)] pub struct RawTable { // Mask to get an index from a hash value. The value is one less than the // number of buckets in the table.