- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I would like to know if scalable_malloc makes any guarantees about zero-initialized memory (for example: always zero-initialized up to requests for X bytes), whether or not this fact can be queried with the API (as in up to how many bytes this guarantee covers) and if it's going to stay like this in the future.
I need to guarantee zero-initialized memory for a project I'm working on, and it's a waste of precious CPU cycles to zero-initialize something if it's already zero-initialized.
Thanks in advance.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jimenez,
TBB Allocator has no any guarantees regarding zero-initialized memory returned by scalable_malloc. However, you can use scalable_calloc instead that is always returns zero-initialized memory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Nikita,
That's a very good point. I hadn't seen that function, and it does do what I need. Thanks :)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page