[jira] [Commented] (ARROW-2434) [Rust] Add windows support

2018-04-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARROW-2434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16432481#comment-16432481
 ] 

ASF GitHub Bot commented on ARROW-2434:
---

paddyhoran commented on issue #1873: ARROW-2434: [Rust] Add windows support
URL: https://github.com/apache/arrow/pull/1873#issuecomment-380146676
 
 
   Ah I see.  Thanks @xhochy, sorry for the silly question...


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Rust] Add windows support
> --
>
> Key: ARROW-2434
> URL: https://issues.apache.org/jira/browse/ARROW-2434
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: Rust
>Reporter: Paddy Horan
>Assignee: Paddy Horan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 0.10.0
>
>
> Currently `cargo test` fails on windows OS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARROW-2434) [Rust] Add windows support

2018-04-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARROW-2434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16432446#comment-16432446
 ] 

ASF GitHub Bot commented on ARROW-2434:
---

paddyhoran commented on issue #1873: ARROW-2434: [Rust] Add windows support
URL: https://github.com/apache/arrow/pull/1873#issuecomment-380138524
 
 
   @xhochy do you know why I am not listed on the 
[contributors](https://github.com/apache/arrow/graphs/contributors) page after 
this getting merged?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Rust] Add windows support
> --
>
> Key: ARROW-2434
> URL: https://issues.apache.org/jira/browse/ARROW-2434
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: Rust
>Reporter: Paddy Horan
>Assignee: Paddy Horan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 0.10.0
>
>
> Currently `cargo test` fails on windows OS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARROW-2434) [Rust] Add windows support

2018-04-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARROW-2434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16431910#comment-16431910
 ] 

ASF GitHub Bot commented on ARROW-2434:
---

xhochy closed pull request #1873: ARROW-2434: [Rust] Add windows support
URL: https://github.com/apache/arrow/pull/1873
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/rust/src/buffer.rs b/rust/src/buffer.rs
index 1cf004fb1..85f57f68c 100644
--- a/rust/src/buffer.rs
+++ b/rust/src/buffer.rs
@@ -22,6 +22,12 @@ use std::slice;
 
 use super::memory::*;
 
+#[cfg(windows)]
+#[link(name = "msvcrt")]
+extern "C" {
+fn _aligned_free(prt: *const u8);
+}
+
 /// Buffer is essentially just a Vec for fixed-width primitive types and 
the start of the
 /// memory region is aligned at a 64-byte boundary
 pub struct Buffer {
@@ -73,6 +79,15 @@ impl Buffer {
 }
 
 impl Drop for Buffer {
+#[cfg(windows)]
+fn drop( self) {
+unsafe {
+let p = mem::transmute::<*const T, *const u8>(self.data);
+_aligned_free(p);
+}
+}
+
+#[cfg(not(windows))]
 fn drop( self) {
 unsafe {
 let p = mem::transmute::<*const T, *mut libc::c_void>(self.data);
diff --git a/rust/src/builder.rs b/rust/src/builder.rs
index 9915a8b52..1744b4eeb 100644
--- a/rust/src/builder.rs
+++ b/rust/src/builder.rs
@@ -23,6 +23,12 @@ use std::slice;
 use super::buffer::*;
 use super::memory::*;
 
+#[cfg(windows)]
+#[link(name = "msvcrt")]
+extern "C" {
+fn _aligned_free(prt: *const u8);
+}
+
 /// Buffer builder with zero-copy build method
 pub struct Builder {
 data: *mut T,
@@ -98,6 +104,17 @@ impl Builder {
 }
 
 impl Drop for Builder {
+#[cfg(windows)]
+fn drop( self) {
+if !self.data.is_null() {
+unsafe {
+let p = mem::transmute::<*const T, *const u8>(self.data);
+_aligned_free(p);
+}
+}
+}
+
+#[cfg(not(windows))]
 fn drop( self) {
 if !self.data.is_null() {
 unsafe {
diff --git a/rust/src/memory.rs b/rust/src/memory.rs
index e3bb786bc..0fc2fda3b 100644
--- a/rust/src/memory.rs
+++ b/rust/src/memory.rs
@@ -22,6 +22,24 @@ use super::error::ArrowError;
 
 const ALIGNMENT: usize = 64;
 
+#[cfg(windows)]
+#[link(name = "msvcrt")]
+extern "C" {
+fn _aligned_malloc(size: libc::size_t, alignment: libc::size_t) -> 
libc::size_t;
+}
+
+#[cfg(windows)]
+pub fn allocate_aligned(size: i64) -> Result<*const u8, ArrowError> {
+let page = unsafe { _aligned_malloc(size as libc::size_t, ALIGNMENT as 
libc::size_t) };
+match page {
+0 => Err(ArrowError::MemoryError(
+"Failed to allocate memory".to_string(),
+)),
+_ => Ok(unsafe { mem::transmute::(page) }),
+}
+}
+
+#[cfg(not(windows))]
 pub fn allocate_aligned(size: i64) -> Result<*const u8, ArrowError> {
 unsafe {
 let mut page: *mut libc::c_void = mem::uninitialized();


 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Rust] Add windows support
> --
>
> Key: ARROW-2434
> URL: https://issues.apache.org/jira/browse/ARROW-2434
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: Rust
>Reporter: Paddy Horan
>Assignee: Paddy Horan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 0.10.0
>
>
> Currently `cargo test` fails on windows OS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARROW-2434) [Rust] Add windows support

2018-04-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARROW-2434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16431907#comment-16431907
 ] 

ASF GitHub Bot commented on ARROW-2434:
---

xhochy commented on issue #1873: ARROW-2434: [Rust] Add windows support
URL: https://github.com/apache/arrow/pull/1873#issuecomment-380015869
 
 
   @paddyhoran I gave you the necessary permissions to assign issues to 
yourself and already assigned this issue to you.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Rust] Add windows support
> --
>
> Key: ARROW-2434
> URL: https://issues.apache.org/jira/browse/ARROW-2434
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: Rust
>Reporter: Paddy Horan
>Assignee: Paddy Horan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 0.10.0
>
>
> Currently `cargo test` fails on windows OS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARROW-2434) [Rust] Add windows support

2018-04-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARROW-2434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16431703#comment-16431703
 ] 

ASF GitHub Bot commented on ARROW-2434:
---

andygrove commented on issue #1873: ARROW-2434: [Rust] Add windows support
URL: https://github.com/apache/arrow/pull/1873#issuecomment-379973257
 
 
   Hi @paddyhoran I tried to assign to you in JIRA but couldn't find your 
username on there. I think you need to create yourself a JIRA account first and 
then you should be able to self-assign.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Rust] Add windows support
> --
>
> Key: ARROW-2434
> URL: https://issues.apache.org/jira/browse/ARROW-2434
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: Rust
>Reporter: Paddy Horan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 0.10.0
>
>
> Currently `cargo test` fails on windows OS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARROW-2434) [Rust] Add windows support

2018-04-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARROW-2434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16431640#comment-16431640
 ] 

ASF GitHub Bot commented on ARROW-2434:
---

paddyhoran commented on issue #1873: ARROW-2434: [Rust] Add windows support
URL: https://github.com/apache/arrow/pull/1873#issuecomment-379958446
 
 
   ARROW-2436 will add CI for windows


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Rust] Add windows support
> --
>
> Key: ARROW-2434
> URL: https://issues.apache.org/jira/browse/ARROW-2434
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: Rust
>Reporter: Paddy Horan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 0.10.0
>
>
> Currently `cargo test` fails on windows OS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (ARROW-2434) [Rust] Add windows support

2018-04-09 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/ARROW-2434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16431621#comment-16431621
 ] 

ASF GitHub Bot commented on ARROW-2434:
---

paddyhoran opened a new pull request #1873: ARROW-2434: [Rust] Add windows 
support
URL: https://github.com/apache/arrow/pull/1873
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> [Rust] Add windows support
> --
>
> Key: ARROW-2434
> URL: https://issues.apache.org/jira/browse/ARROW-2434
> Project: Apache Arrow
>  Issue Type: Improvement
>  Components: Rust
>Reporter: Paddy Horan
>Priority: Major
>  Labels: pull-request-available
> Fix For: 0.10.0
>
>
> Currently `cargo test` fails on windows OS.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)