From: Ian Campbell Subject: Re: Re: [PATCH 0 of 2 V5] libxc: checkpoint compression Date: Tue, 8 Nov 2011 19:56:24 +0000 Message-ID: <1320782185.16747.85.camel@dagon.hellion.org.uk> References: <20147.55048.90214.665321@mariner.uk.xensource.com> <1320771752.955.109.camel@zakaz.uk.xensource.com> <1320772565.955.110.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "rshriram@cs.ubc.ca" Cc: "brendan@cs.ubc.ca" , "xen-devel@lists.xensource.com" , Ian Jackson List-Id: xen-devel@lists.xenproject.org On Tue, 2011-11-08 at 19:41 +0000, Shriram Rajagopalan wrote: > One alternative would be to add the xc_memalign function alone, that > was removed by c/s 22520. 22520 is 22520:6df91a11dcb0 "libxc: remove comment obsoleted by addition of hypercall bounce buffer." here. Did you mean 22312:9fad5e5e2fc1 (remember the cset number is not globally unique/stable, only the longer node hash is) I think putting xc_memalign back would be fine, better than the other options we've discussed even. I'd be tempted to do it as separate functions tools/libxc/xc_{minios,netbsd,linux}.c rather than using #ifdef though. (For my money you can ignore Solaris, it's been unmaintained for long enough that I bet it doesn't even build now and there's no one we can ask to even build test it). > > -void *xc_memalign(size_t alignment, size_t size) > -{ > -#if defined(_POSIX_C_SOURCE) && !defined(__sun__) > - int ret; > - void *ptr; > - ret = posix_memalign(&ptr, alignment, size); > - if (ret != 0) > - return NULL; > - return ptr; > -#elif defined(__NetBSD__) || defined(__OpenBSD__) > - return valloc(size); > -#else > - return memalign(alignment, size); > -#endif > -} > - > > shriram > > > > > > thanks > > shriram > > > > > > Ian. > > > > > > > > shriram > > > > > > > > > > > > Ping. > > > > > > > > > On Fri, Nov 4, 2011 at 5:14 AM, > Ian Jackson > > > wrote: > > > rshriram@cs.ubc.ca writes > ("[PATCH 0 of 2 > > V5] libxc: > > > checkpoint compression"): > > > > This patch series adds > checkpoint > > compression > > > functionality, while > > > > running under Remus. > > > > > > ... > > > > Changes since last > version: > > > > 1. use posix_memalign > only on linux > > platforms and > > > switch to normal malloc > for > > > > the rest. stubdom > compiles > > successfully. > > > > > > > > > Looking at this in more > detail, I don't > > understand why > > > you're using > > > posix_memalign rather than > just malloc, > > anyway. If > > > it's necessary to > > > use posix_memalign on > Linux, why is it OK to > > use > > > malloc on other > > > platforms ? > > > > > > Also this #ifdef is quite > ugly. > > > > > > Ian. > > > > > > > > > > > > > > > > > > > > > > > > >