- 2011-06-15T14:46:59+12:00 (12 years ago)
- 1 edited
r23423 r24162 1483 1483 1484 1484 if (unicode_cat_data != NULL) return; 1485 unicode_cat_data = (unsigned long *) malloc (0x10000/4); 1485 // 64-BIT FIX: The old malloc() parameter calculation assumed that an unsigned long was always 4 bytes, but this 1486 // isn't true on 64-bit machines. Although the space required for this structure is actually the same on 64-bit 1487 // machines (2 bits are needed for each of 65536 values), the rest of the code assumes the machine is 32-bit 1488 // and there are 16 values per array entry. Rather than trying to change the rest of the code to work on both 1489 // 32-bit and 64-bit machines, I've just changed this calculation so the block allocated is twice the size on 1490 // 64-bit machines. This is a bit wasteful because half the space isn't used, but it's only 16KB so I don't 1491 // think it's worth worrying about. [Michael Dewsnip, DL Consulting Ltd.] 1492 unicode_cat_data = (unsigned long *) malloc((0x10000 / 16) * sizeof(unsigned long)); 1486 1493 if (unicode_cat_data == NULL) return; 1487 1494
Note: See TracChangeset for help on using the changeset viewer.