From d8aa0ef9ea0ab0a2e5c641197ab40b79a707ae54 Mon Sep 17 00:00:00 2001
From: James Willis <james.s.willis@durham.ac.uk>
Date: Wed, 18 Apr 2018 16:09:58 +0800
Subject: [PATCH] Allocate structure for VELOCIraptor unit system.

---
 src/velociraptor_interface.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/velociraptor_interface.c b/src/velociraptor_interface.c
index f2734130f9..819ddec605 100644
--- a/src/velociraptor_interface.c
+++ b/src/velociraptor_interface.c
@@ -49,6 +49,9 @@ void velociraptor_init(struct engine *e) {
     struct siminfo sim_info;
     
     struct phys_const vel_const;
+    if (posix_memalign((void **)&(e->stf_units), 32,
+                       sizeof(struct unit_system)) != 0)
+        error("Failed to allocate VELOCIraptor unit system.");
 
     /* Initialize velociraptor unit system and constants */
     units_init(e->stf_units, e->parameter_file, "VelociraptorUnitSystem");
-- 
GitLab