On 4/9/07, J.C. Pizarro <[EMAIL PROTECTED]> wrote:
#include <stddef.h>

void *__allocate_array_OptionA(size_t num, size_t size) { // 1st best
   unsigned long long tmp = (unsigned long long)size * num;
   if (tmp >= 0x0000000080000000ULL) tmp=~size_t(0);
   return operator new[](tmp);
}

First this just happens to be the best for x86, what about PPC or
really any embedded target where people are more concern about code
size than say x86.

Also what about x86_64 where sizeof(size_t) == sizeof(unsigned long
long) so this trick is not going to work

-- Pinski

Reply via email to