| www.delorie.com/archives/browse.cgi | search |
| X-Recipient: | archive-cygwin AT delorie DOT com |
| X-SWARE-Spam-Status: | No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS |
| X-Spam-Check-By: | sourceware.org |
| Message-ID: | <4AF32131.6050204@gmail.com> |
| Date: | Thu, 05 Nov 2009 19:02:09 +0000 |
| From: | Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com> |
| User-Agent: | Thunderbird 2.0.0.17 (Windows/20080914) |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | Re: malloc overrides |
| References: | <4AF29EC2 DOT 2050808 AT users DOT sourceforge DOT net> <4AF2D091 DOT 4030508 AT gmail DOT com> <4AF30A85 DOT 5070208 AT users DOT sourceforge DOT net> <416096c60911051022obc335ceu15dc7ee0e487cb66 AT mail DOT gmail DOT com> <20091105182402 DOT GU26344 AT calimero DOT vinschen DOT de> |
| In-Reply-To: | <20091105182402.GU26344@calimero.vinschen.de> |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sourceware.org/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
Corinna Vinschen wrote:
> On Nov 5 18:22, Andy Koppe wrote:
>> 2009/11/5 Yaakov (Cygwin/X):
>>>>> extern void _exit (int);
>>>>> extern char* strdup (const char*);
>>>> static int are_we_stuck = 1;
>>>>> char* malloc(unsigned n) {
>>>> are_we_stuck = 0;
>>>>> return 0;
>>>>> }
>>>>>
>>>>> int main(void) {
>>>>> strdup("yo");
>>>> _exit (are_we_stuck);
>>>>> }
>>>> FTFY.
>>> Funny, as I went to sleep last night I thought of just that solution. In
>>> practice, though, while it doesn't hang, it doesn't give the correct answer
>>> either. As Corinna said, the malloc override needs to be functional, in
>>> that it allocates memory which can then be free()d. So this isn't going to
>>> be quite so simple. :-(
>> Does the memory actually need to be freed?
>
> Cygwin itself calls free, so the application implementation has to
> provide both.
So probably just adding a dummy free() implementation will do the job?
cheers,
DaveK
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |