HomePhorge

(PUP-2738) Use block form of FFI::MemoryPointer
0673d5441763Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-2738) Use block form of FFI::MemoryPointer

  • Existing uses of FFI::MemoryPointer rely on Ruby GC to perform non-deterministic memory cleanup. In an effort to reduce memory consumption, use the block form of FFI::MemoryPointer to call free on pointers as soon as they're no longer needed.
  • Ensure that we don't use non-local return's anywhere, due to their potential dangerous / unexpected behavior. When inside blocks, store off return values in a separate variable to be returned outside the block. When values are only used inside yields, and the corresponding unmanaged memory has been freed, return nil outside the block.

Details

Provenance
Ethan J. Brown <Iristyle@github>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU006339b66b3e: (PUP-2738) Puppet::Util::Windows::Process FFI clean
Branches
Unknown
Tags
Unknown

Event Timeline

Ethan J. Brown <Iristyle@github> committed rPU0673d5441763: (PUP-2738) Use block form of FFI::MemoryPointer (authored by Ethan J. Brown <Iristyle@github>).Jun 18 2014, 9:16 PM