Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 5103 invoked from network); 26 Jun 2006 23:42:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Jun 2006 23:42:06 -0000 Received: (qmail 12453 invoked by uid 500); 26 Jun 2006 23:42:04 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 12410 invoked by uid 500); 26 Jun 2006 23:42:04 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 12399 invoked by uid 99); 26 Jun 2006 23:42:04 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Jun 2006 16:42:04 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 64.74.244.71 is neither permitted nor denied by domain of geir@pobox.com) Received: from [64.74.244.71] (HELO chi.mobile-health-diary.com) (64.74.244.71) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 26 Jun 2006 16:42:03 -0700 Received: (qmail 13285 invoked from network); 26 Jun 2006 23:41:40 -0000 Received: from unknown (HELO ?10.254.130.17?) (geir@213.94.222.225) by b014.internal.mobile-health-diary.com with SMTP; 26 Jun 2006 23:41:40 -0000 Message-ID: <44A070AD.50406@pobox.com> Date: Mon, 26 Jun 2006 19:41:33 -0400 From: Geir Magnusson Jr Reply-To: geir@pobox.com User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: harmony-dev@incubator.apache.org Subject: Re: [classlib] mem References: <449DC023.4030907@pobox.com> <449F9874.2000909@gmail.com> <449FA3AA.4080401@gmail.com> <449FEC0F.5070505@pobox.com> <44A005E3.9020005@gmail.com> <44A01327.1090706@pobox.com> <44A0448E.5040006@gmail.com> In-Reply-To: <44A0448E.5040006@gmail.com> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Tim Ellison wrote: > Geir Magnusson Jr wrote: >> Tim Ellison wrote: >>> Geir Magnusson Jr wrote: >>>> Except... >>>> >>>> 1) They aren't as Jimmy suggests, at least the one's I'm looking at. >>>> >>>> 2) the implementation in hymem.c just calls malloc() >>>> >>>> I'm confused. >>> Hopefully you are no longer confused after Oliver's explanation. >> Yes, although I am still confused why you would want to do this. > > (I hope I see what you are confused about, but correct me if I'm wrong) > >> We have an implementation in hymem.c : >> >> hymem_alloc_memory( HyPortLib *, int ) > > That is the actual function that allocates memory, and in this case it > is platform specific, eventually calling HeapAlloc on Windows and malloc > on Linux. > > This function is (deliberately) not exported from the hyprt.dll so you > cannot call it directly. You have to call it via the function pointer > table ... That's the missing element - it's not exported. [snip obvious stuff] > > Of course, you can reference that member directly if you so choose, and > as written elsewhere if you are dealing with multiple tables the > syntactic sugar doesn't help and you must reference it in full. > When would you have multiple tables? [snip] > > I guess that the confusion is caused by the HyPortLib struct containing > a member called 'mem_allocate_memory' that has the address of a function > called 'hymem_allocate_memory'? > really it was having a macro and a function named the same, differing only by a number of arguments where the macro expanded out to what has the potential of being something very different than the function because of the function table. It wasn't obvious that the function wasn't exported (of course). thanks geir --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org