Sizes in MEMxxx functions are stored in ints
|
|
Bugzilla Link |
1099 |
Created on |
Oct 15, 2013 10:29 |
Version |
svn |
OS |
All |
Architecture |
All |
Extended Description
Well, first of all this is just wrong.
Secondly, size of int is not guaranteed to be as big as size of void *. Normally it is the case, but in case it won't it will be a mess.
Thirdly, int is signed.
Proposal (1): change all sizes to size_t, matching behaviour of malloc, realloc and free.
Proposal (2): wouldn't it be nicer then to redefine malloc, realloc and free and use them without MEM prefix?
Question: MEMcopy function has weird arguments:
void *MEMcopy( int size, void *mem)
Currently it copies SIZE bytes starting from MEM into newly allocated piece of memory... I would think that the function should be either renamed, or if not, it would be nice to match the arguments to the arguments of memcpy.