I think the code is fine as it is.
The allocator wants to store an extra int in each allocated block and also allocate only even multiples of 32-byte, so it has to add the size of an int + max. 31 bytes of padding to the memory block. This is calculated by adding 31 and then rounding down to the next smaller multiple of 32 with the and operator.
The 64 bit implementation simply needs more space for that extra int, so the number of allocated bytes has to be higher.
Also the sizeof(int) is practically always 4 in this case, because this is in QVM code, which is run on a virtual 32-bit machine, the only possible exception is if you compile it to a 64bit dll.
On the other hand the type of the size parameter (and consequently the allocsize variable) should arguably be an unsigned integer, or the code should check for size < 0 errors.