Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7776721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:57:11+00:00 2026-06-01T17:57:11+00:00

malloc defined like below: void *malloc(size_t size); http://pubs.opengroup.org/onlinepubs/009695399/functions/malloc.html size_t definition (stddef.h): size_t: Unsigned integer

  • 0

malloc defined like below:

void *malloc(size_t size);

http://pubs.opengroup.org/onlinepubs/009695399/functions/malloc.html


size_t definition (stddef.h):

size_t: Unsigned integer type of the result of the sizeof operator.
http://pubs.opengroup.org/onlinepubs/009604499/basedefs/stddef.h.html


But according this page, max limitation of size_t is 65535.
(Section Limits of Other Integer Types):

Limit of size_t: SIZE_MAX 65535
http://pubs.opengroup.org/onlinepubs/007904975/basedefs/stdint.h.html


Does it mean I can not allocate more than 65535 bytes when I want to respect C standard?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:57:11+00:00Added an answer on June 1, 2026 at 5:57 pm

    SIZE_MAX must be at least 65535. If you’re running something like MS-DOS, chances are it’ll actually even be that small. On a typical, reasonably current desktop computer (say, anything less than 10 years old) you can expect it to be larger, typically at least around 4 billion (232-1, to be more exact).

    Whether you need to (try to) deal with a more limited system will depend on the range of targets to which you might care about porting your code. If you really might need to deal with a 16-bit compiler on a system with less than, say, 1 megabyte of addressable memory, then you’ll have to write your code with that in mind. In all honesty, however, for most people that’s simply irrelevant — even relatively small portable systems (e.g., an iPod) can address far more memory than that any more. OTOH, if you’re writing code for a singing greeting card, then yes, such limitations probably come with the territory (but in such cases, the standard is often something to treat more as a general guideline than an absolute law).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine I am doing something like this: void *p = malloc (1000); *((char*)p) =
When malloc is called, the size is stored adjacent to the allocated block so
I have a structure defined like so: typedef struct { int n; int *n_p;
I have a class Foo defined like this: class Foo { public: Foo(int num);
I understand how malloc() works. My question is, I'll see things like this: #define
I've seen a class which is a class which is defined like this.. class
I would like to replace the default malloc at link time to use a
I get this warning. I would like defined behavior but i would like to
I currently have a library-like .c file (that'll be shown below). I have 2
Can someone explain me the working of a malloc wrapper for below code?? RTLD_NEXT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.