Hacker News new | past | comments | ask | show | jobs | submit login

Memory management under PL/I.

It was a highly optimised sorting algorithm for client names, and used everywhere. It occasionally dropped a name, and I was asked to fix it.

PL/I allows you to free part of allocated memory. In this case, two names would be pulled out of the array, that part of the array would be freed, and turned into a new array instance. Pair got sorted and reinserted. Repeat until array becomes array of single arrays, then bitshift edge of array allocations to recreate array in place.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: