[H5r-commits] r95 - / R src tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 2 22:14:30 CEST 2013


Author: extemporaneousb
Date: 2013-07-02 22:14:29 +0200 (Tue, 02 Jul 2013)
New Revision: 95

Modified:
   DESCRIPTION
   R/h5R.R
   src/h5_wrap.c
   tests/testMemory.R
Log:
Removed the malloc_trim code because it is not portable. 



Modified: DESCRIPTION
===================================================================
--- DESCRIPTION	2013-06-26 05:46:59 UTC (rev 94)
+++ DESCRIPTION	2013-07-02 20:14:29 UTC (rev 95)
@@ -1,7 +1,7 @@
 Package: h5r
 Type: Package
 Title: Interface to HDF5 Files
-Version: 1.4.5
+Version: 1.4.6
 Date: 2011-09-19
 Author: James Bullard
 Maintainer: James Bullard <jbullard at pacificbiosciences.com>

Modified: R/h5R.R
===================================================================
--- R/h5R.R	2013-06-26 05:46:59 UTC (rev 94)
+++ R/h5R.R	2013-07-02 20:14:29 UTC (rev 95)
@@ -120,10 +120,6 @@
   .myCall("h5R_get_object_count", .ePtr(h5File))
 }
 
-.mallocTrim <- function() {
-  .myCall("h5R_malloc_trim")
-}
-
 setMethod("getH5Group", c("H5Container", "character"), function(h5Obj, groupName) {
   if (is.null(x <- .myCall("h5R_get_group", .ePtr(h5Obj), groupName)))
     stop(paste("Group:", groupName, "cannot be opened."))

Modified: src/h5_wrap.c
===================================================================
--- src/h5_wrap.c	2013-06-26 05:46:59 UTC (rev 94)
+++ src/h5_wrap.c	2013-07-02 20:14:29 UTC (rev 95)
@@ -4,11 +4,6 @@
 #include <hdf5.h>
 #include <Rinternals.h>    
 #include <R.h>
-#ifdef __APPLE__
-#include <malloc/malloc.h>
-#else
-#include <malloc.h>
-#endif
 
 #define DEBUG 0
 #define MEMORYDEBUG 0
@@ -23,14 +18,6 @@
     hid_t id;
 } h5_holder;
 
-SEXP h5R_malloc_trim() {
-#ifdef __GLIBC__
-    return ScalarInteger(malloc_trim(0));
-#else
-    return ScalarInteger(-1);
-#endif
-}
-
 void h5R_finalizer(SEXP h5_obj) {
     h5_holder* h = (h5_holder*) R_ExternalPtrAddr(h5_obj);
     if (! h) {
@@ -63,9 +50,6 @@
     
     // This call is seemingly a noop.
     H5garbage_collect();
-
-    // Not sure if calling this here will be sufficient. 
-    h5R_malloc_trim();
 }
 
 SEXP _h5R_make_holder (hid_t id, int is_file) {

Modified: tests/testMemory.R
===================================================================
--- tests/testMemory.R	2013-06-26 05:46:59 UTC (rev 94)
+++ tests/testMemory.R	2013-07-02 20:14:29 UTC (rev 95)
@@ -27,13 +27,16 @@
 
 gc()
 
+## 7/2/2013 - malloc_trim commented out for CRAN submission.
+
+
 showPS()
 m <- .Call("h5R_allocate_gig")
 b <- 'bar' # from the post, "blocking the memory"
 rm(m)
 gcl()
 showPS()
-h5r:::.mallocTrim()
+# h5r:::.mallocTrim()
 showPS()
 
 m <- sapply(1:1000, function(a) {
@@ -43,7 +46,7 @@
 rm(m)
 gcl()
 showPS()
-h5r:::.mallocTrim()
+# h5r:::.mallocTrim()
 showPS()
 
 m <- sapply(1:100000, function(a) {
@@ -53,7 +56,7 @@
 rm(m)
 gcl()
 showPS()
-h5r:::.mallocTrim()
+# h5r:::.mallocTrim()
 showPS()
 
 m <- sapply(1:1000000, function(a) {
@@ -63,5 +66,5 @@
 rm(m)
 gcl()
 showPS()
-h5r:::.mallocTrim()
+# h5r:::.mallocTrim()
 showPS()



More information about the H5r-commits mailing list