Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 402
    • Issues 402
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1159
Closed
Open
Created Oct 15, 2013 by Artem Shinkarov@temaOwner

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.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking