Article View: comp.sys.mac.programmer.codewarrior
Article #1391Re: MP-safe MSL/new()
From: Howard Hinnant
Date: Mon, 09 Oct 2000 00:00
Date: Mon, 09 Oct 2000 00:00
14 lines
1621 bytes
1621 bytes
In article <karsten.loeffler-96141C.08284709102000@news.belwue.de>, Karsten Loeffler <karsten.loeffler@uni-tuebingen.de> wrote: | I've wondered how it can be detected if memory block representented by a | pointer wether it was allocated by NewPtr() or MPAllocate(). | But now a will try to alloctae everything with MPAllocate without any | use of NewPtr() You could rig __sys_alloc/free to detect the difference. Just allocate some extra space and put a flag there saying who allocated the memory. However be careful that the pointer you return has the proper alignment properties (currently set to 16 byte alignment for AltiVec compatibility). -Howard
Technical Details
Message-ID:
<hinnant-0910000843440001@ith3-384.twcny.rr.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<karsten.loeffler-7D396D.15575505102000@newsserv.uni-tuebingen.de> <hinnant-0510001154380001@ith3-473.twcny.rr.com> <karsten.loeffler-E694CB.17013406102000@news.belwue.de> <hinnant-0610001317070001@ith3-43b.twcny.rr.com> <karsten.loeffler-96141C.08284709102000@news.belwue.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bcce,6951f08fa8b3ff8d X-Google-Attributes: gid10bcce,public X-Google-Thread: f635e,6951f08fa8b3ff8d X-Google-Attributes: gidf635e,public From: hinnant@anti-spam_metrowerks.com (Howard Hinnant) Subject: Re: MP-safe MSL/new() Date: 2000/10/09 Message-ID: <hinnant-0910000843440001@ith3-384.twcny.rr.com> X-Deja-AN: 679285475 References: <karsten.loeffler-7D396D.15575505102000@newsserv.uni-tuebingen.de> <hinnant-0510001154380001@ith3-473.twcny.rr.com> <karsten.loeffler-E694CB.17013406102000@news.belwue.de> <hinnant-0610001317070001@ith3-43b.twcny.rr.com> <karsten.loeffler-96141C.08284709102000@news.belwue.de> X-Complaints-To: abuse@twcny.rr.com X-Trace: typhoon.nyroc.rr.com 971095187 24.24.13.132 (Mon, 09 Oct 2000 08:39:47 EDT) Organization: Metrowerks NNTP-Posting-Date: Mon, 09 Oct 2000 08:39:47 EDT Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac