News for hackers. Stuff that matters.
Re:Fewer mallocs in curl by tomlu on Sunday April 23, 2017 @05:30PM (#14180565)
Well there are situations where intrusive list pointers don't work well. If you don't control the class, then you simply can't put pointers in it. If most objects aren't ever in a list (eg. a million objects but only ten in a list at any given time), then you're wasting space. If you want to put objects in several different lists, then you have to know up front how many lists and their names, and this can become unmanageable.
Re:Fewer mallocs in curl by daemin on Monday April 24, 2017 @06:55AM (#14183267)
You can always allocate memory big enough for a the payload plus the link structure without the links actually being inside of the payload. Just make the first part of memory contain the links and immediately afterward you have the payload.