#49002 Replace memset on struct allocation
Closed: Fixed None Opened 3 years ago by firstyear.

c99 supports the following:

struct Slapi_PBlock pb = {0};

This creates a null struct on the stack. Which is a lot nicer that memsetting the value.

We should improve this where possible through out our code.

I was very careful to leave memsets in for and while loops where they are needed. I only removed or replaced where it would be safe. Additionally, this extends to a reduction in the calls to pblock_init, which also would have been a huge cost on the server (712 byte writes, very frequently).

commit b1f434e
Writing objects: 100% (77/77), 10.81 KiB | 0 bytes/s, done.
Total 77 (delta 65), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
86bffc8..b1f434e master -> master

Metadata Update from @firstyear:
- Issue assigned to firstyear
- Issue set to the milestone: 1.3.6 backlog

3 years ago

Login to comment on this ticket.