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